Skip to content

Commit

Permalink
Add implementors guide
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jan 29, 2024
1 parent c5bc58b commit 728cc79
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 20 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## [1.0.8] - Unreleased
- Import from pydantic v2 lib first
- Fixed prefix extraction during normalization
- Added implementors guide to README.md
- Improved pydantic v2 import logic
- Improved prefix extraction during normalization
- Improved canonical ISCC string validation

## [1.0.7] - 2024-01-07
Expand Down
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,56 @@ general digital asset management use-cases.

## What is `iscc-core`

`iscc-core` is a python based reference library of the core algorithms to create standard-compliant
ISCC codes. It also a good reference for porting ISCC to other programming languages.
`iscc-core` is the python based reference implementation of the ISCC core algorithms as defined by
[ISO 24138](https://www.iso.org/standard/77899.html). It also a good reference for porting ISCC to
other programming languages.

!!! tip
This is a low level reference implementation that does not inlcude features like mediatype
detection, metadata extraction or file format specific content extraction. Please have a look at
the [iscc-sdk](https://github.com/iscc/iscc-sdk) which adds those higher level features on top
of the `iscc-core` library.
[iscc-sdk](https://github.com/iscc/iscc-sdk) which adds those higher level features on top of
the `iscc-core` library.

## Project Status
## Implementors Guide

The ISCC is under development as [ISO/CD 24138](https://www.iso.org/standard/77899.html) -
International Standard Content Code within
[ISO/TC 46/SC 9/WG 18](https://www.iso.org/committee/48836.html).
### Reproducible Environment

For reproducible installation of the reference implementation we included a `poetry.lock` file with
pinned dependencies. Install them using [Python Poetry](https://pypi.org/project/poetry/) with the
command `poetry install` in the root folder.

### Repository structure

```
iscc-core
├── docs # Markdown and other assets for mkdocs documentation
├── examples # Example scripts using the reference code
├── iscc_core # Actual source code of the reference implementation
├── tests # Tests for the reference implementation
└── tools # Development tools
```

### Testing & Conformance

The reference implementation comes with 100% test coverage. To run the conformance selftest from the
repository root use `poetry run python -m iscc_core`. To run the complete test suite use
`poetry run pytest`.

To build a conformant implementation work through the follwing top level entrypoint functions:

```
gen_meta_code_v0
gen_text_code_v0
gen_image_code_v0
gen_audio_code_v0
gen_video_code_v0
gen_mixed_code_v0
gen_data_code_v0
gen_instance_code_v0
gen_iscc_code_v0
```

The corresponding test vectors can be found in `iscc_core/data.json`.

## ISCC Architecture

Expand Down
5 changes: 3 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog

## [1.0.8] - Unreleased
- Import from pydantic v2 lib first
- Fixed prefix extraction during normalization
- Added implementors guide to README.md
- Improved pydantic v2 import logic
- Improved prefix extraction during normalization
- Improved canonical ISCC string validation

## [1.0.7] - 2024-01-07
Expand Down
52 changes: 44 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,56 @@ general digital asset management use-cases.

## What is `iscc-core`

`iscc-core` is a python based reference library of the core algorithms to create standard-compliant
ISCC codes. It also a good reference for porting ISCC to other programming languages.
`iscc-core` is the python based reference implementation of the ISCC core algorithms as defined by
[ISO 24138](https://www.iso.org/standard/77899.html). It also a good reference for porting ISCC to
other programming languages.

!!! tip
This is a low level reference implementation that does not inlcude features like mediatype
detection, metadata extraction or file format specific content extraction. Please have a look at
the [iscc-sdk](https://github.com/iscc/iscc-sdk) which adds those higher level features on top
of the `iscc-core` library.
[iscc-sdk](https://github.com/iscc/iscc-sdk) which adds those higher level features on top of
the `iscc-core` library.

## Project Status
## Implementors Guide

The ISCC is under development as [ISO/CD 24138](https://www.iso.org/standard/77899.html) -
International Standard Content Code within
[ISO/TC 46/SC 9/WG 18](https://www.iso.org/committee/48836.html).
### Reproducible Environment

For reproducible installation of the reference implementation we included a `poetry.lock` file with
pinned dependencies. Install them using [Python Poetry](https://pypi.org/project/poetry/) with the
command `poetry install` in the root folder.

### Repository structure

```
iscc-core
├── docs # Markdown and other assets for mkdocs documentation
├── examples # Example scripts using the reference code
├── iscc_core # Actual source code of the reference implementation
├── tests # Tests for the reference implementation
└── tools # Development tools
```

### Testing & Conformance

The reference implementation comes with 100% test coverage. To run the conformance selftest from the
repository root use `poetry run python -m iscc_core`. To run the complete test suite use
`poetry run pytest`.

To build a conformant implementation work through the follwing top level entrypoint functions:

```
gen_meta_code_v0
gen_text_code_v0
gen_image_code_v0
gen_audio_code_v0
gen_video_code_v0
gen_mixed_code_v0
gen_data_code_v0
gen_instance_code_v0
gen_iscc_code_v0
```

The corresponding test vectors can be found in `iscc_core/data.json`.

## ISCC Architecture

Expand Down
10 changes: 10 additions & 0 deletions iscc_core/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
import iscc_core as ic


def selftest():
return ic.conformance_selftest()


if __name__ == "__main__": # pragma: no cover
selftest()
5 changes: 5 additions & 0 deletions tests/test_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
from typing import Generator
import pytest
from iscc_core import conformance
from iscc_core.__main__ import selftest


def test_generate_tests():
test_generator = conformance.conformance_testdata()
assert isinstance(test_generator, Generator)


def test_selftest():
assert selftest() is True


def test_confromance_selftest():
assert conformance.conformance_selftest()

Expand Down

0 comments on commit 728cc79

Please sign in to comment.