readdata
Read repository files and structured data releases transparently—locally, over HTTP(S), from GitHub, Zenodo, or Figshare, or in the browser (Pyodide / marimo WebAssembly).
readdata provides two small, complementary APIs with isolated dependencies:
Repo/repo_file(core —urllib3only): resolve individual files (.csv,.trc,.c3d,.txt,.xlsx, images, archives) locally first, falling back to an atomic cached HTTP(S) download from GitHub, Figshare, or any HTTP URL with optional SHA-256 verification.Release(optional[release]extra —duckdb+fsspec): open manifest-backed data releases (metadata.json) or remote archive files from a local directory, an HTTP mirror, Zenodo, or Figshare with lazy DuckDB SQL views over Parquet and seekable byte-range streams (including Pyodide/WebAssembly for CORS-enabled hosts).
Installation
For repository, GitHub, and Figshare file access (lightweight, pure Python):
pip install readdata
For manifest-backed Parquet/DuckDB releases and remote byte-range streaming:
pip install "readdata[release]"
For Polars lazy scans (Release.lazyframe()):
pip install "readdata[polars]"
For remote binary streaming without DuckDB:
pip install "readdata[http]"
1. Repository, GitHub, and Figshare files (Repo & repo_file)
Designed for notebooks and scripts that should read a local checkout when present and automatically fetch a temporary cached copy when opened standalone (e.g., in molab, marimo.app, Google Colab, or GitHub Pages WebAssembly):
from readdata import Repo, repo_file
# GitHub repository (e.g., BMClab/BMC tutorial notebooks)
bmc = Repo.github("BMClab/BMC", ref="master")
walk = bmc.file("data/walk.trc")
# Public Figshare article resolved by real filename (e.g., RBDS v4)
rbds = Repo.figshare(4543435, version=4)
files = rbds.list_files()
static = rbds.file("RBDS001static.txt")
# Optional SHA-256 verification
sample = bmc.file("data/walk.trc", sha256="...")
# Or resolve a single file directly from any HTTP(S) base URL
path = repo_file(
"data/walk.trc",
base_url="https://raw.githubusercontent.com/BMClab/BMC/master/",
)
Local lookup walks upward from start_dir (defaulting to marimo.notebook_dir() when running inside marimo, otherwise the current working directory). Pass local=False to force fetching from the remote URL.
2. Structured releases & byte-range streaming (Release)
Designed for versioned datasets whose root directory contains a metadata.json file mapping resource names to relative paths (and optional bytes and zenodo_filename fields), as well as direct byte-range streaming into large remote archives on Zenodo, Figshare, or HTTP mirrors:
{
"resources": {
"trials": {"path": "trials.parquet", "bytes": 41200, "sha256": "...", "group": "core"},
"features": {"path": "features/pressure.parquet", "zenodo_filename": "features_pressure.parquet"},
"signals": {
"paths": [
{"path": "signals/part1.parquet", "bytes": 1200000, "sha256": "..."},
{"path": "signals/part2.parquet", "bytes": 1350000, "sha256": "..."}
],
"union_by_name": true,
"groups": ["signals", "core"]
},
"scans": {"path": "scans.zip", "bytes": 182400120}
}
}
Open a local directory, HTTP(S) mirror, Zenodo record, Figshare article, or resolve automatically (environment variable → local directory → remote fallback):
from zipfile import ZipFile
from readdata import Release
# Local first (env var or local directory with metadata.json), else Zenodo
ppds = Release.auto("data", env="PPDS_DATA", fallback=Release.zenodo(24544934))
# Inspect available Parquet tables without touching remote files
names = ppds.table_names(group="core")
# Query Parquet resources lazily with DuckDB (selective by name or group, or incremental via register)
with ppds.connect(["trials", "contacts"]) as con:
rows = con.sql("SELECT * FROM trials LIMIT 5").fetchall()
# Or scan directly with Polars (requires `pip install "readdata[polars]"`)
lf = ppds.lazyframe("signals")
# Verify local downloads against manifest bytes and SHA-256 digests
ppds.verify()
# Stream a single file out of a large remote ZIP without downloading the archive
with ppds.open_resource("scans") as stream, ZipFile(stream) as archive:
mesh = archive.read("scans/s001l_foot.stl")
# Or stream one trial straight out of a 585 MB Figshare ZIP (WBDS v2)
wbds = Release.figshare(5722711, version=2)
with wbds.open_file("WBDSascii.zip") as stream, ZipFile(stream) as archive:
trial = archive.read("WBDS01walkO01Cgrf.txt")
In Pyodide/WebAssembly, Release automatically uses synchronous Web Worker XMLHttpRequest byte-range reads registered as an fsspec filesystem for DuckDB—no httpfs extension required. (Note: GitHub and Zenodo serve browser-compatible CORS headers; Figshare's Cloudflare R2 download redirects currently omit CORS headers, so Figshare access works in local Python, Google Colab, and molab server sessions rather than direct browser WebAssembly.)
Example marimo notebooks
Executable marimo notebooks in docs/ demonstrate each workflow against real public biomechanics datasets:
| Notebook | What it demonstrates | Cloud / browser |
|---|---|---|
docs/github_repo_files.py |
Repo.github, repo_file, functools.partial, sha256 verification with BMClab/BMC |
Open in molab · Open in marimo.app |
docs/zenodo_releases.py |
Release.auto, Release.zenodo, DuckDB SQL views over remote Parquet, and byte-range streaming from scans.zip with PPDS |
Open in molab · Open in marimo.app |
docs/figshare_datasets.py |
Repo.figshare, list_files(), and Release.figshare byte-range streaming from a 585 MB ZIP with RBDS & WBDS |
Open in molab |
docs/multi_file_releases.py |
Multi-file paths resources (union_by_name), group filtering, incremental register(), Polars lazyframe(), and local verify() |
Open in molab · Open in marimo.app |
See docs/design_choices.md for the rationale behind Release's manifest schema, selective registration, multi-file union_by_name, dependency isolation, and testing layout.
Run any example locally with uv:
uv run --extra release --group docs marimo edit docs/github_repo_files.py
How to cite
If you use readdata in your research, please cite:
- Duarte, M. (2026). readdata: Read files and structured data releases locally, over HTTP, from GitHub, Zenodo, or Figshare, or in the browser. Zenodo. https://doi.org/10.5281/zenodo.24826839 (resolves to the latest release).
License
MIT License. See LICENSE.
Metadata
Release files for readdata 0.3.0
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 |
|---|---|---|---|---|
| readdata-0.3.0.tar.gz | 29.4 kB | With provenance | Details for readdata-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readdata-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for readdata-0.3.0-py3-none-any.whl |
Total release size: 48.1 kB
Release files / readdata-0.3.0.tar.gz
| Download URL | readdata-0.3.0.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd17c227f17fb4123a725ac98c722ccbe11a4647215f4d960015ecbcb68e6698
|
|
BLAKE2b-256 checksum How to use checksums |
31e6944fc6909c4bdd02ae230a30ef2210266303a9d78cfd99e25cba952d4516
|
| 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 Dec 4, 2026.
Transparency logRelease files / readdata-0.3.0-py3-none-any.whl
| Download URL | readdata-0.3.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a0f0926ea1f521b7f3c59d5fa36e6cb0d3c70b7b1813f4ed86f9a19ca008bdc
|
|
BLAKE2b-256 checksum How to use checksums |
9aaeeafa032c8aba59470c0b4fef2bad748bb40c94b5dc766e5b396661291944
|
| 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 Dec 4, 2026.
Transparency logSecurity for readdata 0.3.0
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
Both files in this release have been uploaded with provenance metadata.
Attestation for readdata-0.3.0.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 Dec 4, 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.