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

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

Total release size: 240.0 MB

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

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

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

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

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

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

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

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

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

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

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

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

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

Download URL oxenai-0.70.1-cp311-abi3-macosx_10_13_x86_64.whl
Size 35.7 MB
Tags CPython 3.11 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
348bdc7b568c56aa27dd8f504a78d54e532dd77f2f29b5394c05f6fdfe36fb14
BLAKE2b-256 checksum
How to use checksums
ca4c1898e8db8e8c57efbeef07ccc4ed5dcf02309227f963dc073f34f51ff452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

Security for oxenai 0.70.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.

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.

Release history Release notifications | RSS feed

This release

0.70.1 This release

7 release files No provenance

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