Skip to main content

readdata

PyPI version DOI

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:

  1. Repo / repo_file (core — urllib3 only): 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.
  2. 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 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},
    "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, 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))

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

# 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

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

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.2.1
File Size Uploaded Provenance Actions
readdata-0.2.1.tar.gz 23.9 kB With provenance Details for readdata-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 39.8 kB

Release files / readdata-0.2.1.tar.gz

Download URL readdata-0.2.1.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c00e0af7e20b0c1fa3ab3bdcc04c6ce5d935c671f12168b6958034db0499293
BLAKE2b-256 checksum
How to use checksums
20078320cd39250d103f786498aa44aa342f63ed96f6783b70d50b41e7c15e51
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.2.1-py3-none-any.whl

Download URL readdata-0.2.1-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55001d957e2e5ec177c9def47f5894ebe3b8b4fab4b4ba5ef56a520b565d66ae
BLAKE2b-256 checksum
How to use checksums
4b83cd64fb7df498d2c97005dad3b6b144940e2cc80b440d09889d1f7cf0da05
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.2.1

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