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.

Metadata

Release files for oxenai 0.61.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.61.0
File
oxenai-0.61.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
oxenai-0.61.0-cp311-abi3-manylinux_2_34_x86_64.whl CPython 3.11 abi3 Linux glibc 2.34+ x86-64 Details
oxenai-0.61.0-cp311-abi3-manylinux_2_34_aarch64.whl CPython 3.11 abi3 Linux glibc 2.34+ ARM64 Details
oxenai-0.61.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
oxenai-0.61.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
oxenai-0.61.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
oxenai-0.61.0-cp311-abi3-macosx_10_13_x86_64.whl CPython 3.11 abi3 macOS 10.13+ x86-64 Details

Total release size: 237.2 MB

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

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

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

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

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

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

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

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

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

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

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

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

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

Download URL oxenai-0.61.0-cp311-abi3-macosx_10_13_x86_64.whl
Size 35.3 MB
Tags CPython 3.11 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
c130cd94896c42b461a0706a7148e524a503b871fc407d742c529df90a0c1369
BLAKE2b-256 checksum
How to use checksums
55a8713b5bfe93fa033e2b8ac1c77f20ead0d8e7df7c4c8f8173290934aab850
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