Skip to main content

ISCC - Core Algorithms

Reason this release was yanked:

Package dependency error

Project description

ISCC - Codec & Algorithms

Build Version Coverage Quality Downloads

iscc-core is the reference implementation of the core algorithms of the ISCC (International Standard Content Code)

What is the ISCC

The ISCC is a similarity preserving fingerprint and identifier for digital media assets.

ISCCs are generated algorithmically from digital content, just like cryptographic hashes. However, instead of using a single cryptographic hash function to identify data only, the ISCC uses various algorithms to create a composite identifier that exhibits similarity-preserving properties (soft hash).

The component-based structure of the ISCC identifies content at multiple levels of abstraction. Each component is self-describing, modular, and can be used separately or with others to aid in various content identification tasks. The algorithmic design supports content deduplication, database synchronization, indexing, integrity verification, timestamping, versioning, data provenance, similarity clustering, anomaly detection, usage tracking, allocation of royalties, fact-checking and 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.

!!! 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 which adds those higher level features on top of the iscc-core library.

Project Status

The ISCC is under development as ISO/CD 24138 - International Standard Content Code within ISO/TC 46/SC 9/WG 18.

ISCC Architecture

ISCC Architecture

ISCC MainTypes

Idx Slug Bits Purpose
0 META 0000 Match on metadata similarity
1 SEMANTIC 0001 Match on semantic content similarity
2 CONTENT 0010 Match on perceptual content similarity
3 DATA 0011 Match on data similarity
4 INSTANCE 0100 Match on data identity
5 ISCC 0101 Composite of two or more components with common header

Installation

Use the package manager pip to install iscc-core.

pip install iscc-core

Quick Start

import json
import iscc_core as ic

meta_code = ic.gen_meta_code(name="ISCC Test Document!")

print(f"Meta-Code:     {meta_code['iscc']}")
print(f"Structure:     {ic.iscc_explain(meta_code['iscc'])}\n")

# Extract text from file
with open("demo.txt", "rt", encoding="utf-8") as stream:
    text = stream.read()
    text_code = ic.gen_text_code_v0(text)
    print(f"Text-Code:     {text_code['iscc']}")
    print(f"Structure:     {ic.iscc_explain(text_code['iscc'])}\n")

# Process raw bytes of textfile
with open("demo.txt", "rb") as stream:
    data_code = ic.gen_data_code(stream)
    print(f"Data-Code:     {data_code['iscc']}")
    print(f"Structure:     {ic.iscc_explain(data_code['iscc'])}\n")

    stream.seek(0)
    instance_code = ic.gen_instance_code(stream)
    print(f"Instance-Code: {instance_code['iscc']}")
    print(f"Structure:     {ic.iscc_explain(instance_code['iscc'])}\n")

# Combine ISCC-UNITs into ISCC-CODE
iscc_code = ic.gen_iscc_code(
    (meta_code["iscc"], text_code["iscc"], data_code["iscc"], instance_code["iscc"])
)

# Create convenience `Code` object from ISCC string
iscc_obj = ic.Code(iscc_code["iscc"])
print(f"ISCC-CODE:     {ic.iscc_normalize(iscc_obj.code)}")
print(f"Structure:     {iscc_obj.explain}")
print(f"Multiformat:   {iscc_obj.mf_base32}\n")

# Compare with changed ISCC-CODE:
new_dc, new_ic = ic.Code.rnd(mt=ic.MT.DATA), ic.Code.rnd(mt=ic.MT.INSTANCE)
new_iscc = ic.gen_iscc_code((meta_code["iscc"], text_code["iscc"], new_dc.uri, new_ic.uri))
print(f"Compare ISCC-CODES:\n{iscc_obj.uri}\n{new_iscc['iscc']}")
print(json.dumps(ic.iscc_compare(iscc_obj.code, new_iscc["iscc"]), indent=2))

The output of this example is as follows:

Meta-Code:     ISCC:AAAT4EBWK27737D2
Structure:     META-NONE-V0-64-3e103656bffdfc7a

Text-Code:     ISCC:EAAQMBEYQF6457DP
Structure:     CONTENT-TEXT-V0-64-060498817dcefc6f

Data-Code:     ISCC:GAA7UJMLDXHPPENG
Structure:     DATA-NONE-V0-64-fa258b1dcef791a6

Instance-Code: ISCC:IAA3Y7HR2FEZCU4N
Structure:     INSTANCE-NONE-V0-64-bc7cf1d14991538d

ISCC-CODE:     ISCC:KACT4EBWK27737D2AYCJRAL5Z36G76RFRMO4554RU26HZ4ORJGIVHDI
Structure:     ISCC-TEXT-V0-MCDI-3e103656bffdfc7a060498817dcefc6ffa258b1dcef791a6bc7cf1d14991538d
Multiformat:   bzqavabj6ca3fnp757r5ambeyqf6457dp7isywhoo66i2npd46hiutektru

Compare ISCC-CODES:
ISCC:KACT4EBWK27737D2AYCJRAL5Z36G76RFRMO4554RU26HZ4ORJGIVHDI
ISCC:KACT4EBWK27737D2AYCJRAL5Z36G7Y7HA2BMECKMVRBEQXR2BJOS6NA
{
  "meta_dist": 0,
  "content_dist": 0,
  "data_dist": 33,
  "instance_match": false
}

Documentation

Documentation is published athttps://core.iscc.codes

Development

Requirements

  • Python 3.7.2 or higher for code generation and static site building.
  • Poetry for installation and dependency management.

Development Setup

git clone https://github.com/iscc/iscc-core.git
cd iscc-core
poetry install

Development Tasks

Tests, coverage, code formatting and other tasks can be run with the poe command:

poe

Poe the Poet - A task runner that works well with poetry.
version 0.18.1

Result: No task specified.

USAGE
  poe [-h] [-v | -q] [--root PATH] [--ansi | --no-ansi] task [task arguments]

GLOBAL OPTIONS
  -h, --help     Show this help page and exit
  --version      Print the version and exit
  -v, --verbose  Increase command output (repeatable)
  -q, --quiet    Decrease command output (repeatable)
  -d, --dry-run  Print the task contents but don't actually run it
  --root PATH    Specify where to find the pyproject.toml
  --ansi         Force enable ANSI output
  --no-ansi      Force disable ANSI output
CONFIGURED TASKS
  gentests       Generate conformance test data
  format         Code style formating with black
  docs           Copy README.md to /docs
  format-md      Markdown formating with mdformat
  lf             Convert line endings to lf
  test           Run tests with coverage
  sec            Security check with bandit
  all

Use poe all to run all tasks before committing any changes.

Maintainers

@titusz

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss your plans. Please make sure to update tests as appropriate.

You may also want join our developer chat on Telegram at https://t.me/iscc_dev.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iscc_core-1.0.5.tar.gz (58.0 kB view details)

Uploaded Source

Built Distributions

iscc_core-1.0.5-cp312-cp312-win_amd64.whl (635.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

iscc_core-1.0.5-cp312-cp312-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp312-cp312-macosx_11_0_x86_64.whl (823.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ x86-64

iscc_core-1.0.5-cp311-cp311-win_amd64.whl (634.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

iscc_core-1.0.5-cp311-cp311-manylinux_2_31_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp311-cp311-macosx_11_0_x86_64.whl (820.9 kB view details)

Uploaded CPython 3.11 macOS 11.0+ x86-64

iscc_core-1.0.5-cp310-cp310-win_amd64.whl (634.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

iscc_core-1.0.5-cp310-cp310-manylinux_2_31_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp310-cp310-macosx_11_0_x86_64.whl (644.7 kB view details)

Uploaded CPython 3.10 macOS 11.0+ x86-64

iscc_core-1.0.5-cp39-cp39-win_amd64.whl (634.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

iscc_core-1.0.5-cp39-cp39-manylinux_2_31_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp39-cp39-macosx_11_0_x86_64.whl (645.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

iscc_core-1.0.5-cp38-cp38-win_amd64.whl (635.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

iscc_core-1.0.5-cp38-cp38-manylinux_2_31_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp38-cp38-macosx_11_0_x86_64.whl (645.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

iscc_core-1.0.5-cp37-cp37m-win_amd64.whl (635.9 kB view details)

Uploaded CPython 3.7m Windows x86-64

iscc_core-1.0.5-cp37-cp37m-manylinux_2_31_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.31+ x86-64

iscc_core-1.0.5-cp37-cp37m-macosx_11_0_x86_64.whl (646.6 kB view details)

Uploaded CPython 3.7m macOS 11.0+ x86-64

File details

Details for the file iscc_core-1.0.5.tar.gz.

File metadata

  • Download URL: iscc_core-1.0.5.tar.gz
  • Upload date:
  • Size: 58.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d8549b279365dde41583e13ba5574d4596ce18c7ac9724e151682d55c196f524
MD5 2960dc5d995d9037e42888c4a1f2fc0d
BLAKE2b-256 72f81a8187fc5e9159dfb64a38d3084c8f1073a4170606813be41b9bb15468b1

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 635.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 67ca179ea7da0ece6624408aba50a058a68a0d8736ed84b8a00ab67d6c7bab6c
MD5 6d867d804d6691695c638be3d3b0da67
BLAKE2b-256 ddb61880e6a2f163314d1f46fb77766aad199627df789a7a816ab57339c8891b

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 56fd1b74fbe7bcf86b8ab95df8efde5f47983bc1c5843a2381b689ab9033ac8e
MD5 df8347954a0cb6e9f45ea1c8c94a134b
BLAKE2b-256 0aba366bdda0f42e5af1e031f1364868f9c775b3ea38fa63d55f9c42ddedbda2

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b7c2f9486a5a9ded1a39036fc6e128fc6c9823a1825c27025917595822668e48
MD5 deeab8807a58810d620041ac0181777b
BLAKE2b-256 9f12e4319fb35feea2f3fefacaa39ae7e14dd595a8c1cfeec7b89bc1626381ee

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 634.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cf6383962a92e00ce6b32e6a34dd23d01a5319899b0bf16b631816ba93a0ed62
MD5 6846de9f24afb3d8eb39fb1a92fa04a9
BLAKE2b-256 cc45ba16775987e93bec29d6f532f8b92b65c9d7e669b991479a8d46e2bf0cf0

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 088ce64cc941d8c72ec21fe3bbd371a358d040beb3da3c3a5d893b2ae5b42aae
MD5 a69a6a48c564b51854fe5af5efb0df9f
BLAKE2b-256 d7b922784bb0da95fd50485e47db641f8e50caf878b98f92f624f44d5f66f424

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 11a227619c9c1d755aa1ebe4bf257ea5d55172c3211d3d711626535ead4a427d
MD5 188d4cc8de5c98af50267f5136870e03
BLAKE2b-256 a096df6269ab1952bc652dd44b125e246b9369701475297342a89881f5d080a1

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 634.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7d052f560c72cae7806a7fa25117f4417fb331375262d2cd667a0b624292869e
MD5 0a508a472cd85a234d8376c656f8c6ed
BLAKE2b-256 d7bd32c2e019e9f4e115e696e1b169fc6840042499a82e9013a8e414a4d1ce90

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp310-cp310-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp310-cp310-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e3709acde0a36a2f1f92c02a3d178fc71e73e3c01dd2a706a9d3e06a6599ef70
MD5 44a5b631fe02478cce5c1f2d5bcff397
BLAKE2b-256 d40d67a2c56e810f70f4f026787547f5ef87395d683d2e7673ac5ad99b1e32c4

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c18ba0a89c5bd52f0e45342f90e59e905369cd0f440631cdf7d9cd867808ba81
MD5 977fed3d00ea79d9e9a4cdc3f5e48e5b
BLAKE2b-256 df037cf1b14bd5b2d7409a0b6ef85961dc335dd6458bf14727e06543d0e6145e

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 634.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5e34ceed1bbfdae31e15563a2dfc06d0270f8feaf6452c194ccd211d670c8195
MD5 0f74de227f66db0cd9609faaf5343386
BLAKE2b-256 4f0fbe28d7816bebf27fa08da72b48f034eeaf3c546d4edbefb3558bf40135e5

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp39-cp39-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp39-cp39-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 4f1c7527cccd8037654ff98ceb7a0994914c91dc736f3756be7c473e730854ca
MD5 9f603274d8251812335af79ba220bcf8
BLAKE2b-256 b7421982225d3725bfff815102b142af95eefab33512941fac482160c5cc83e6

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4c384859a6c8b0bb4da4a2747abf56594c101be610014ef8d04f8fe9f9f8026b
MD5 626f88fef2f50161654d61f1d4d53217
BLAKE2b-256 3677b0eba908b947e1ac9ec7151ba7cf073cd4015aade0696d59dabd4652eb5f

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 635.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 873eb6174d8de53378550a00807f0934d90737acde00096b20d933cdbe9b9b36
MD5 f2de6f5e8904278c0a717a02f4c73131
BLAKE2b-256 cf8d280144b854368ea9f7e1ac846e575a72ee9bb73f3b2afff7c315ed86a5f8

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 07258edd660558a123ae28c67829f5a17ec02fbf20a2c4082dc76969a38d6a9f
MD5 0cefe339b16df5b4012ed42b0b26916d
BLAKE2b-256 69ae2d976e2008fc35fbcf8ab5eba2d593ef9bdbdf02f8c6ef931de6ad327383

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6f32c54c5f4ceb7c0449acda34bcc084a344b32811d5dea787afd626cd2b104b
MD5 755a57e793a6ec8a303ff02f5367e589
BLAKE2b-256 0c080992b0a1eb722832f08891591f0c705b875495b8ecde997ef0303fcfd352

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: iscc_core-1.0.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 635.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.1 Windows/10

File hashes

Hashes for iscc_core-1.0.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a197ef2f742b43ba324fe972d134ab6aac7800a89f2622926bb8076ce67b0b6a
MD5 03a3055a4f07419d6404f11410a0410e
BLAKE2b-256 b714a8a08631cf35f6ce306e2b9e87cc0b746a6e55a5be5a39182d04fac23715

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp37-cp37m-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp37-cp37m-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ed12250246ec0d3487b5baed407aeed221a27a298da89f9e0dd061f308fae7f7
MD5 901dd188ec53e2f7e241b8321e49d867
BLAKE2b-256 e90d013a0b1c76a0056ae44753629cff1a3a33059564dd2a36ab4896a54796f4

See more details on using hashes here.

File details

Details for the file iscc_core-1.0.5-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for iscc_core-1.0.5-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c78c727b66d0f431c7571adf5f31f7866e63d336786b28393318f2471ef34b29
MD5 b129317030003749c2f62235f5da4522
BLAKE2b-256 364b5a5f590287af935c7c22afd7470f2c9533cc181608176d446a4cb6a5900e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page