seamless-core
seamless-core is the foundational data layer of the Seamless ecosystem. It provides a content-addressed data model built around two core abstractions — Checksum and Buffer — together with a cell type system for serializing and converting structured data, and a smart in-memory buffer cache.
While seamless-core underpins higher-level Seamless packages (seamless-config, seamless-remote, seamless-transformer, seamless-dask), it is also usable on its own as a content-addressed data serialization and caching library.
Core concepts
Checksum
Checksum wraps a SHA-256 hash as a first-class Python object. Beyond simple identity, it supports:
- Construction from hex strings, raw bytes, or other
Checksuminstances. resolve()— retrieve the corresponding buffer from the local cache or a remote server.fingertip()— resolve with fallback to recomputation (if a transformation produced this checksum).incref()/decref()/tempref()— reference counting to keep buffers alive in the cache.load()/save()— file I/O (auto-appends.CHECKSUMextension).
Buffer
Buffer represents raw content (bytes) paired with an optional checksum. It bridges Python values and content-addressed storage:
- Construct from raw bytes, or from a Python value plus a cell type:
Buffer(value, celltype="plain"). get_value(celltype)— deserialize the buffer back to a Python object.get_checksum()— compute the SHA-256 checksum (lazily, cached).incref()/decref()/tempref()— manage buffer lifetime in the cache.load()/save()— file I/O.
Cell types and conversions
Seamless defines 13 cell types that govern how Python values are serialized into buffers and deserialized back:
| Cell type | Serialized form |
|---|---|
plain |
JSON (2-space indent, sorted keys) |
text, python, ipython |
UTF-8 text (with AST/syntax validation for code types) |
yaml |
UTF-8 YAML text |
str, int, float, bool |
JSON scalar + newline |
binary |
NumPy .npy format |
bytes |
Raw bytes |
mixed |
Umbrella format for heterogeneous data (nested dicts/lists containing numpy arrays, scalars, and strings). "plain" and "binary" are special cases of "mixed" |
checksum |
Hex-encoded SHA-256 strings (or dicts/lists thereof) |
A complete conversion matrix classifies every possible type-pair conversion:
- Trivial — checksum-preserving, always safe (e.g.
text→bytes). - Reinterpret — checksum-preserving, may fail (reverse of trivial).
- Reformat — may change checksum, always safe (e.g.
bytes→binary). - Possible — may change checksum, may fail (e.g.
mixed→int). - Forbidden — requires value-level evaluation or is disallowed.
This conversion system ensures that type coercions across the Seamless ecosystem are well-defined and reproducible.
Buffer cache
The buffer cache is a dual weak/strong in-memory store:
- Weak cache — buffers registered without references; eligible for garbage collection.
- Strong cache — buffers with active references (
increfortempref); kept alive.
Temporary references (tempref) model decaying interest — useful for intermediate results that may or may not be needed again. When memory usage exceeds configurable soft/hard caps (default 5 GB / 50 GB), the cache evicts buffers in cost-aware order, considering download cost, recomputation cost, and buffer size.
Installation
pip install seamless-core
CLI scripts
Installing seamless-core also provides:
seamless-checksum— compute the SHA-256 checksum of a file.seamless-checksum-file— compute and write a.CHECKSUMsidecar file.seamless-checksum-index— build checksum indices for directories.
Development build
python -m pip install --upgrade build
python -m build
Metadata
Release files for seamless-core 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seamless_core-0.1.4.tar.gz | 55.4 kB | Without provenance | Details for seamless_core-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seamless_core-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for seamless_core-0.1.4-py3-none-any.whl |
Total release size: 118.6 kB
Release files / seamless_core-0.1.4.tar.gz
| Download URL | seamless_core-0.1.4.tar.gz |
|---|---|
| Size | 55.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab32017f9294307511ccd06dfe944273ffa33cd88dd23c4b281b7b259dc2ad90
|
|
BLAKE2b-256 checksum How to use checksums |
ab5436ac836f00990c39fc2fd618fcaeec14b6222cca447f79a7beaf6fce95ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / seamless_core-0.1.4-py3-none-any.whl
| Download URL | seamless_core-0.1.4-py3-none-any.whl |
|---|---|
| Size | 63.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bd8cb72ce674a0bf9f0bc16d78190ce7ac9190d84a325aae4ce3d51e68490fd
|
|
BLAKE2b-256 checksum How to use checksums |
8aed0723d5679582c85c49172429b6817886e4db13c76b6a625f7f3ae41442c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for seamless-core 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.