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

Total release size: 237.4 MB

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

Download URL oxenai-0.63.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
c61d99e48a6dc8508d14f119b9119a3f3bcb2217f40e812ae2d84b96c3d0eaa3
BLAKE2b-256 checksum
How to use checksums
d2d985576cdcb10291ca7d50fdefa9048d77224e80b0b94e2222b47262d2bdc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

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

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

Download URL oxenai-0.63.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
b9eee36b5da3c0a481970fbe8692e629802f2800d60f6d70a3c2ca806125cb31
BLAKE2b-256 checksum
How to use checksums
a3c9cfb6dc09b1ae06683f6628db010338d5a24b5f81e7d402b10f9a7e52f25f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

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

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

Download URL oxenai-0.63.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
3e72341ebcb084fa6609c45c9a2677c65316a1e83584c09feb2bf75318a92fbe
BLAKE2b-256 checksum
How to use checksums
b17f3886d5f082a3f07366d731be2c18fa51fe2bde32d736cd115a2d6d2167e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

Download URL oxenai-0.63.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
ed62b45c8b9ee2169be922669024f3ae44802121f5a1ef18e7ddddca43920523
BLAKE2b-256 checksum
How to use checksums
dd6dd7f09333254f1d3a07f7664eaec8f87b8316c7739861f9ff082654dd3a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

Download URL oxenai-0.63.0-cp311-abi3-macosx_10_13_x86_64.whl
Size 35.4 MB
Tags CPython 3.11 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
8af2f2c70eadc2a6242e8c1c737a5601f148c2e97e205c2cca7aac7bbc4ebe60
BLAKE2b-256 checksum
How to use checksums
f8c02fc443849ca773c52a2e6e5b9c098fb34795ae55ad0ffef00dd5ac8dae92
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