Skip to main content

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


Download files

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

Source Distribution

sciduckdb-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sciduckdb-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

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

Hashes for sciduckdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad2c5d7b9efea2f0b0aab171ac68c66e80f98a2378d10fc45971c2261c816710
MD5 d6f793e35483a0ff48a46a9ea2220635
BLAKE2b-256 a9bc10aa1e931809c0f9d4193c2a9624dbff8334b4810602f6133e46bf1e424c

See more details on using hashes here.

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

Hashes for sciduckdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4aeec4fb4bec572be3dbe84836477627256b337147ced912dbe8d22b2a39af65
MD5 cd46d6c11648aad770b2b621163f073a
BLAKE2b-256 d12a47536cd50fb8173280a7daff48b2f7b98844cb55bf213bebc5726c3c8f6c

See more details on using hashes here.

Supported by

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