Skip to main content

🐂 🐍 Oxen Python Interface

The Oxen python interface makes it easy to integrate Oxen datasets directly into machine learning dataloaders or other data pipelines.

Repositories

There are two types of repositories one can interact with, a Repo and a RemoteRepo.

Local Repo

To fully clone all the data to your local machine, you can use the Repo class.

import oxen

repo = oxen.Repo("path/to/repository")
repo.clone("https://hub.oxen.ai/ox/CatDogBBox")

If there is a specific version of your data you want to access, you can specify the branch when cloning.

repo.clone("https://hub.oxen.ai/ox/CatDogBBox", branch="my-pets")

Once you have a repository locally, you can perform the same operations you might via the command line, through the python api.

For example, you can checkout a branch, add a file, commit, and push the data to the same remote you cloned it from.

import oxen

repo = oxen.Repo("path/to/repository")
repo.clone("https://hub.oxen.ai/ox/CatDogBBox")
repo.checkout()

Remote Repo

If you don't want to download the data locally, you can use the RemoteRepo class to interact with a remote repository on OxenHub.

import oxen

repo = oxen.RemoteRepo("https://hub.oxen.ai/ox/CatDogBBox")

To stage and commit files to a specific version of the data, you can checkout an existing branch or create a new one.

repo.create_branch("dev")
repo.checkout("dev")

You can then stage files to the remote repository by specifying the file path and destination directory.

repo.add("new-cat.png", "images") # Stage to images/new-cat.png on remote
repo.commit("Adding another training image")

Note that no "push" command is required here, since the above code creates a commit directly on the remote branch.

Build 🔨

See the prerequisites section of the main readme before developing.

To get and build dependencies, as well as the oxen-python code, run:

uv sync --verbose

To build the PyO3 oxen wrappers only, use maturin and --no-sync:

uv run --no-sync maturin develop

Test

Run pytest:

uv run --verbose pytest -s tests/

If you have already installed all dependencies, and you're not making any changes to liboxen, then you may use --no-sync:

uv run --no-sync pytest -s tests/

Format and lint code with:

uvx ruff check .
uvx ruff format .

Logging

Oxen uses structured logging. It outputs to STDERR by default but can be configured with rotating log files. See Logging for details.

By default, the oxen-python does not perform any logging. Set RUST_LOG to change.

Release files for oxenai 0.58.0

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

Built distributions (wheels)

Table of built distributions (wheels) for oxenai 0.58.0
File
oxenai-0.58.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
oxenai-0.58.0-cp311-abi3-manylinux_2_34_x86_64.whl CPython 3.11 abi3 Linux glibc 2.34+ x86-64 Details
oxenai-0.58.0-cp311-abi3-manylinux_2_34_aarch64.whl CPython 3.11 abi3 Linux glibc 2.34+ ARM64 Details
oxenai-0.58.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
oxenai-0.58.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
oxenai-0.58.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
oxenai-0.58.0-cp311-abi3-macosx_10_13_x86_64.whl CPython 3.11 abi3 macOS 10.13+ x86-64 Details

Total release size: 217.7 MB

Release files / oxenai-0.58.0-cp311-abi3-win_amd64.whl

Download URL oxenai-0.58.0-cp311-abi3-win_amd64.whl
Size 31.3 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e5e5f7763dae250744cc0d8121244f554920e997824ea8a5584fb87e92f438b7
BLAKE2b-256 checksum
How to use checksums
6ed2389f8df6ca77c4da509577030fe0c486b51874ef10187652ef3efd752a94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-manylinux_2_34_x86_64.whl

Download URL oxenai-0.58.0-cp311-abi3-manylinux_2_34_x86_64.whl
Size 31.7 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
5eba27ad228c1f480918c404b1d6c2ece263731a8843c732bf7e912f16afeb13
BLAKE2b-256 checksum
How to use checksums
bdc8d8bb6195f9adf81b4f475fe58f4c3b64c49bf63f209e35851e6d1f90516b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-manylinux_2_34_aarch64.whl

Download URL oxenai-0.58.0-cp311-abi3-manylinux_2_34_aarch64.whl
Size 30.1 MB
Tags CPython 3.11 Linux glibc 2.34+ ARM64 abi3
SHA-256 checksum
How to use checksums
9b2842439fa55ad5a8a00090a5cd4bb32abaf179f0f0230214f76b55586fe205
BLAKE2b-256 checksum
How to use checksums
f4a4d0ed0af92bbed094d71f34d71ba9dfda8994aa04f5b89c29e70e915a394e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL oxenai-0.58.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 32.0 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6f068591af12b3c0e5e889b7fb6c5830186edca2a1181f5290867e18d98ccd28
BLAKE2b-256 checksum
How to use checksums
f85b95fa2774b33bb26fe4b5812bc8d7460799d7f8b839083d74c7fa4689a693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL oxenai-0.58.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 30.3 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
b8a1da2c39d5219b21b7ed6777a296cef622827388942acddfa749c366fe1be6
BLAKE2b-256 checksum
How to use checksums
ce8a825e73f916c893b639092daa62ede037b2579bcd41bcb9493d7055e23d50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL oxenai-0.58.0-cp311-abi3-macosx_11_0_arm64.whl
Size 29.8 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d57d7c295fa1f965fef77899c6619902d762759ea42d14e9bebc8670d0a4f35b
BLAKE2b-256 checksum
How to use checksums
84b7fa2ecfbabae82331403e19382d1a719a499a74d1b6be25b14415fc05d2f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Release files / oxenai-0.58.0-cp311-abi3-macosx_10_13_x86_64.whl

Download URL oxenai-0.58.0-cp311-abi3-macosx_10_13_x86_64.whl
Size 32.5 MB
Tags CPython 3.11 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
06ad52c2c3c1429f44aafae739757a4f99a1e61259c8af3b35279e4637b507db
BLAKE2b-256 checksum
How to use checksums
07dec72788d34cd0639bb22d938d98e0296c665167c7e73007b6570f66272938
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4
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