Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Orcapod

Orcapod is a Python library for building reproducible scientific data pipelines. Data enters a pipeline through sources and flows through typed, immutable streams, in which every row is a tag (the keys that identify the row) and its data. Function pods compute new values from each row's data with plain Python functions; operators join, filter, group and reshape streams without computing new values. A job runs these steps against a database: every function result is stored, and a later run computes only what is not stored yet. Every row records which source and which source row it came from, and every value carries a provenance token.

Installation

Orcapod supports Python 3.11, 3.12 and 3.13 and is published on PyPI as orcapod. 0.1.4 is the latest stable release there (0.3.0 was withdrawn); a plain uv add orcapod installs it. The workshop uses the latest 0.4.0 release candidate, which the commands below install.

The recommended way to install it is uv: uv add adds Orcapod to a uv project (start one with uv init in a new directory), and uv run runs your code in that project's environment:

uv add "orcapod>=0.4.0rc7"

In an environment not managed by uv, use pip install "orcapod>=0.4.0rc7" instead. For the development version, install from the repository: uv add git+https://github.com/metamorphic-labs/orcapod-python.

Tables written by 0.2.0 or earlier are not read by this version: see Upgrading from 0.2.0 (it also covers 0.1.4).

Optional features are installed as extras, for example uv add "orcapod[spiraldb]":

Extra Adds
orcapod[ray] Distributed execution with RayExecutor (Ray 2.60 or later, which has no wheel for Intel macOS)
orcapod[redis] RedisCacher, a Redis-backed hash cache
orcapod[postgresql] The PostgreSQL connector, table source and file hash cache (psycopg 3.1.17 or later)
orcapod[spiraldb] The SpiralDB connector and table source, read only (spiral-sdk)
orcapod[torch] PyTorch, for torch.Tensor values (any installed torch works)
orcapod[all] All of the above

A quick example

A source of two rows, one function pod, and a job that stores its results in a database:

from orcapod import PipelineJob, function_pod
from orcapod.databases import InMemoryArrowDatabase
from orcapod.sources import DictSource


@function_pod(output_keys="temp_fahrenheit")
def to_fahrenheit(temperature: float) -> float:
    return temperature * 9.0 / 5.0 + 32.0


rows = [
    {"experiment": "exp_001", "temperature": 20.5},
    {"experiment": "exp_002", "temperature": 22.3},
]
database = InMemoryArrowDatabase()


def run_job(rows):
    source = DictSource(data=rows, tag_columns=["experiment"], source_id="lab_results")
    job = PipelineJob(name="lab", database=database)
    with job:  # record the steps; nothing runs yet
        to_fahrenheit.pod(source, label="fahrenheit")
    print(job.run())
    return job


job = run_job(rows)
# Run of job 'lab': all rows succeeded.
#   fahrenheit: 2 rows: 2 computed, 0 from store, 0 failed
print(job.nodes["fahrenheit"].as_table().sort_by("experiment").to_pylist())
# [{'experiment': 'exp_001', 'temp_fahrenheit': 68.9}, {'experiment': 'exp_002', 'temp_fahrenheit': 72.14}]

A function pod drops unused data columns by default. Pass strict_columns=True to reject them.

Add a row and run a new job over the same database. The two stored results are found again by their input values, and only the new row is computed:

rows.append({"experiment": "exp_003", "temperature": 19.8})
job = run_job(rows)
# Run of job 'lab': all rows succeeded.
#   fahrenheit: 3 rows: 1 computed, 2 from store, 0 failed

InMemoryArrowDatabase keeps results for the life of the Python process; DeltaTableDatabase("some/directory") writes them to disk, so they are found again in a new session.

Documentation

  • Getting Started: sources, streams and function pods, step by step.
  • Tutorials: a self-paced core course in seven parts, from a first stream to a stored, re-runnable pipeline, and short tutorials on files, inspecting results, tracing a value, chaining pipelines and handling errors, with exercises.
  • Concepts: sources, streams, function pods, operators, pipelines and jobs, identity and hashing, file types, arrays and your own data types.
  • Reference: Hashing and Golden hashes.
  • Troubleshooting: common errors, their causes and fixes.
  • CHANGELOG: what changed in each release, with upgrade notes.

Status

Orcapod is before version 1.0. In the development version (0.4.0 is next):

  • Hash values of data context v1 freeze at 0.4.0. Hashes name stored tables and find stored results again, so a hash value released in 0.4.0 will not change in a later release of the same data context; CI checks this. Until 0.4.0 a v1 hash may still change, only by an approved and explained change (0.3.0, which first shipped v1, was withdrawn). This does not cover a provisional operator (such as Filter and GroupBy): its identity, and every hash downstream of it, may still change in a later release of v1. See Golden hashes and Provisional operators.
  • Library value types are provisional. The hashes of numpy.ndarray, torch.Tensor, and pandas and polars DataFrame and Series values are provisional until the library value type audit (after 0.4.0rc1) and may change then; results computed from them may then be computed again. Using one issues ProvisionalHashWarning once per type per process.
  • Stores from earlier versions are not read as current. Tables written by 0.1.x or 0.2.0 are neither read as results nor modified, and results stored by a development build before v1 was released may not be found again by a later build, which then computes them again. Read Upgrading from 0.2.0 before running a job over an old store, in particular one with side-effect nodes.
  • Connector databases cannot hold function nodes yet. A job over a SQLite, PostgreSQL or SpiralDB database refuses every function node when it is built. Use InMemoryArrowDatabase or DeltaTableDatabase for jobs.

SpikeInterface support lives in a separate package, orcapod-extension-spikeinterface. It is not published on PyPI; install it from its repository.

Contributing

CONTRIBUTING.md has the development setup, the checks every pull request must pass, and the project's conventions. Releases are cut by the GitHub Actions Release workflow; see RELEASING.md.

License

Orcapod is released under the MIT License.

Metadata

Release files for orcapod 0.4.0rc10

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

Source distribution (sdist)

Source distribution for orcapod 0.4.0rc10
File Size Uploaded Provenance Actions
orcapod-0.4.0rc10.tar.gz 1.4 MB Without provenance Details for orcapod-0.4.0rc10.tar.gz

Built distribution (wheel)

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

Total release size: 3.1 MB

Release files / orcapod-0.4.0rc10.tar.gz

Download URL orcapod-0.4.0rc10.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
445363ba7b0f36963a17a115dc2ca8a7cd3f9535d0a171ffff9b6628b7191937
BLAKE2b-256 checksum
How to use checksums
440fd367947e248af07e65dd8b9fa3c34878f726c40e2bff8ddea7e4b343e6a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / orcapod-0.4.0rc10-py3-none-any.whl

Download URL orcapod-0.4.0rc10-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
008989cc8dbb37222896921ed6119d60751f3ec8cab02f2112a6ee218f0510c5
BLAKE2b-256 checksum
How to use checksums
f33fcae7247eb6e99f1451399eec3fa4ec7c26417bba4b2b51f0380cb664f502
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for orcapod 0.4.0rc10

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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