This release is a pre-release and may not be stable for production use.
datarecord
Dimensioned attribute data with a declared schema.
A record holds components (named members of a type), connections between components and buses, attribute values over both, and the axes those values vary along. A schema declares what may exist; the data says what does.
Records stack: a layer is a partial record on top of a parent, resolved last-writer-wins, so a scenario variant costs the rows it changes rather than a copy of everything. On disk a record is a plain parquet directory that a tool knowing nothing about this package can read.
datarecord depends only on duckdb, narwhals and pydantic. It names no modelling framework — a framework consumes a record, a workflow engine produces one, and neither needs to know how the other works.
Documentation
Full documentation is at https://energy-models.github.io/datarecord/:
- Usage — reading, editing, layering and writing a record
- Design — what a record is and why, the authoritative design
- API Reference — every public symbol
Installation
pip install datarecord # core
pip install datarecord[pypsa] # with the PyPSA tool
A taste
from datarecord import DirectoryRecord, connect
con = connect()
record = DirectoryRecord("s3://bucket/my-record/", con)
record.entity_types["Generator"].collect() # wide member rows
record.attributes["p_max_pu"].collect() # long value rows, one per value
record.flags("Generator") # which axes each attribute uses
Every frame is a narwhals.LazyFrame — a plan, not data. Nothing is read until you .collect().
Records stack, and a WorkingRecord accumulates edits that become one layer at commit:
from datarecord import WorkingRecord, NewChild
w = WorkingRecord(revision.record, con)
w.set("p_nom", 150.0, names=["wind1", "wind2"])
child = w.commit(NewChild())
See Usage for the rest.
Development
This project is managed by pixi:
git clone https://github.com/energy-models/datarecord
cd datarecord
pixi run test # the test suite
pixi run lint # ruff, prettier, taplo, typos, zizmor, reuse, mypy
See CONTRIBUTING.md for the workflow and conventions, and AGENTS.md for how AI-assisted contributions must be marked.
Metadata
Release files for datarecord 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datarecord-0.1.0a1.tar.gz | 115.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datarecord-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 231.4 kB
Release files / datarecord-0.1.0a1.tar.gz
| Download URL | datarecord-0.1.0a1.tar.gz |
|---|---|
| Size | 115.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c06ca750a34d6cc345cca9fa0435ad6a5afb6cd1669598bab490a3dd136ee6d
|
|
BLAKE2b-256 checksum How to use checksums |
d92dba2e076fdcbe0a9495624f0860dd31c2975bcb1c423c5d0c9890420a23f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency logRelease files / datarecord-0.1.0a1-py3-none-any.whl
| Download URL | datarecord-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 116.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13ffdab8365531b3dd34e5fc71d029cb99ab8f5a9da888b6f96a2ff7abbd83ab
|
|
BLAKE2b-256 checksum How to use checksums |
fbc2dcb04248b59f3f66cff89a4c0e02498c11191fda7665a7da06ec1478aa83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 24, 2026.
Transparency log