Skip to main content

readdata

Read repository files and structured data releases transparently—locally, over HTTP(S), from GitHub or Zenodo, or in the browser (Pyodide / marimo WebAssembly).

readdata provides two small, complementary APIs with isolated dependencies:

  1. Repo / repo_file (core — urllib3 only): resolve individual repository files (.csv, .trc, .c3d, .txt, images, archives) locally first, falling back to an atomic cached HTTP(S) download with optional SHA-256 verification.
  2. Release (optional [release] extra — duckdb + fsspec): open manifest-backed data releases (metadata.json) from a local directory, an HTTP mirror, or a numbered Zenodo record with lazy DuckDB SQL views over Parquet and seekable binary streams (including byte-range reads in Pyodide).

Installation

For repository/notebook file access (lightweight, pure Python):

pip install readdata

For manifest-backed Parquet/DuckDB releases and remote streaming:

pip install "readdata[release]"

For remote binary streaming without DuckDB:

pip install "readdata[http]"

1. Repository 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

# Configure a GitHub repository once (e.g., in a BMC tutorial notebook)
bmc = Repo.github("BMClab/BMC", ref="master")
walk = bmc.file("data/walk.trc")

# 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 data releases (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):

{
  "resources": {
    "trials": {"path": "trials.parquet", "bytes": 41200},
    "features": {"path": "features/pressure.parquet", "zenodo_filename": "features_pressure.parquet"},
    "scans": {"path": "scans.zip", "bytes": 182400120}
  }
}

Open a local directory, HTTP(S) mirror, Zenodo record, 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
rel = Release.auto("data", env="PPDS_DATA", fallback=Release.zenodo(24544934))

# Query Parquet resources lazily with DuckDB
with rel.connect(["trials", "features"]) as con:
    rows = con.sql("SELECT * FROM trials LIMIT 5").fetchall()

# Stream a binary archive using byte ranges without downloading the whole file
with rel.open_resource("scans") as stream, ZipFile(stream) as archive:
    mesh = archive.read("scans/s001l_foot.stl")

In Pyodide/WebAssembly, Release automatically uses synchronous Web Worker XMLHttpRequest byte-range reads registered as an fsspec filesystem for DuckDB—no httpfs extension required.

License

MIT License. See LICENSE.

Metadata

Release files for readdata 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for readdata 0.1.0
File Size Uploaded Provenance Actions
readdata-0.1.0.tar.gz 17.9 kB With provenance Details for readdata-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for readdata 0.1.0
File Interpreter ABI Platform Actions
readdata-0.1.0-py3-none-any.whl Python 3 none any Details for readdata-0.1.0-py3-none-any.whl

Total release size: 30.3 kB

Release files / readdata-0.1.0.tar.gz

Download URL readdata-0.1.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
adf7cdd3aba1c0e00b12b7bca4dfeaa2c24423464f9b6a89eb3551c8b1c92050
BLAKE2b-256 checksum
How to use checksums
46139f7379b422544ef0a99fdbefb1bebe5e617cd651da74d421fa63be8c9e5b
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 log

Release files / readdata-0.1.0-py3-none-any.whl

Download URL readdata-0.1.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9ad51c42eca2b1c92b4353a693ad28e8f561618973f5a150b3b5cf6387d6fa8
BLAKE2b-256 checksum
How to use checksums
4229fc379e6d3c69f0b9350a2da905d6248d5555f2df020db447ffa352847daa
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 log

Security for readdata 0.1.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.

Select from 2 files

Attestation for readdata-0.1.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page