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

Total release size: 217.8 MB

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

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

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

Download URL oxenai-0.58.1-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
755873ae790ed0bfb8012f236850fc3c1430d5d55669a44606ef1708ff1be037
BLAKE2b-256 checksum
How to use checksums
61a1ded2e8605cfcbe848ec189586569b0a99aa94ad4e506dd0cc7a1ad2f259a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

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

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

Download URL oxenai-0.58.1-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
639701c38b21c90de37819c9a27d9bb15c09d7c79c993998ccad4f79b33209b6
BLAKE2b-256 checksum
How to use checksums
50f4757e9a530c6be1bcc24187396fa149791380eda78f997b8375029d55061b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

Download URL oxenai-0.58.1-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
9a48284f395f005956127a92c1bbe647281c469b20b50a06ad5bbfe9e265c6a2
BLAKE2b-256 checksum
How to use checksums
5653e80240983f71d8e4cd5ac945f168a9cdf0d122a9a0349e7fd0aae09d5f95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

Download URL oxenai-0.58.1-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
48c77f2de50488730218d45f895a8e0eb6b321b04223900e666481d08847dfe8
BLAKE2b-256 checksum
How to use checksums
93093e8e003b82fec408fa94bb35f935fc1a1ad45c07fdb5e83eaa8ab6cc21f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

Download URL oxenai-0.58.1-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
4d0e6502d4cd7d500fc9575d1ed55ce96578aad0a4e2519d24dfade103292e45
BLAKE2b-256 checksum
How to use checksums
a0aaa8e5320cdc1933351f4a0795018e08d251f4b07bf7ef5997a3a5dac439d8
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