SciDuck
A thin DuckDB layer for managing versioned scientific data.
Each variable is stored in its own table. Variables are associated with a hierarchical dataset schema (e.g. subject -> session -> trial) and can be saved at any level of that hierarchy. Multiple versions of each variable are supported natively.
All data -- including arrays -- is stored in queryable DuckDB types (LIST, nested LIST, JSON) so the database can be inspected with DBeaver or any DuckDB-compatible viewer.
Usage
from sciduckdb import SciDuck
duck = SciDuck("data.duckdb", dataset_schema=["subject", "session"])
duck.save("MyVar", data, subject="S01", session=1)
loaded = duck.load("MyVar", subject="S01", session=1)
Features
- Three save modes: DataFrame with schema columns (Mode A), single entry via kwargs (Mode B), or dict mapping tuples to values (Mode C)
- Automatic type inference: Maps Python/numpy types to DuckDB types
- Round-trip restoration: Metadata tracks original types for lossless load
- Version management: Automatic version numbering, duplicate hash detection
- Variable groups: Organize variables into named groups
- Schema validation: Validates dataset schema consistency across sessions
Note: all schema key values are coerced to strings before storage.
Datetimes
A datetime value (datetime.datetime, pd.Timestamp, np.datetime64, NaT) is
stored as two columns: <col> TIMESTAMP_NS holding the UTC instant (or a
naive value's wall clock), and <col>__tz VARCHAR holding that value's zone
("Europe/Berlin", "UTC", "+02:00"; NULL = naive). Zones are per value, so
one column may hold several zones and naive values. Loads give back each value
in its own zone. The __tz column exists from the column's first save and is
never listed in the variable's data columns. In raw SQL, filter on
<col>__tz IS NULL to tell naive rows apart. Owner: sciduckdb.datetimes;
design: docs/claude/datetime-roundtrip.md.
Metadata
Release files for sciduckdb 0.1.56
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 | |
|---|---|---|---|---|
| sciduckdb-0.1.56.tar.gz | 31.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sciduckdb-0.1.56-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 63.8 kB
Release files / sciduckdb-0.1.56.tar.gz
| Download URL | sciduckdb-0.1.56.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff597770dfc779de655cd0fc4bdceeb70826bde4c34bb743f70d15b80dd18e9d
|
|
BLAKE2b-256 checksum How to use checksums |
2cb42188bbb0f64d871b2453945fb7194568c59aba194bbe9178fe79966bad00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / sciduckdb-0.1.56-py3-none-any.whl
| Download URL | sciduckdb-0.1.56-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92a6316db317b8c76f8e36d208940b82b77e703ed54af46ee609ee6cff9d89b8
|
|
BLAKE2b-256 checksum How to use checksums |
e4134977f12efe9df774bedc963a4e02b0e59a2990772d33882129e085fa266a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for sciduckdb 0.1.56
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sciduckdb-0.1.56.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA 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.