A thin DuckDB layer for managing versioned scientific data
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sciduckdb-0.1.0.tar.gz.
File metadata
- Download URL: sciduckdb-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad2c5d7b9efea2f0b0aab171ac68c66e80f98a2378d10fc45971c2261c816710
|
|
| MD5 |
d6f793e35483a0ff48a46a9ea2220635
|
|
| BLAKE2b-256 |
a9bc10aa1e931809c0f9d4193c2a9624dbff8334b4810602f6133e46bf1e424c
|
File details
Details for the file sciduckdb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sciduckdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aeec4fb4bec572be3dbe84836477627256b337147ced912dbe8d22b2a39af65
|
|
| MD5 |
cd46d6c11648aad770b2b621163f073a
|
|
| BLAKE2b-256 |
d12a47536cd50fb8173280a7daff48b2f7b98844cb55bf213bebc5726c3c8f6c
|