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

Total release size: 237.5 MB

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

Download URL oxenai-0.60.0-cp311-abi3-win_amd64.whl
Size 34.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9ad9d79113e98d7cfdfd9e2d26d5ab2515fb83e291052f8f9536d6c1b72c694b
BLAKE2b-256 checksum
How to use checksums
99c8f103b7ec78335f84250f5634ae3c5f5694dcf1e8eaa1aa299cab99be9daf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.8.4

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

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

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

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

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

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

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

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

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

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

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

Download URL oxenai-0.60.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
af056a4602a4a2862e71a6cc61f6baa2b929a706e0e4508f6d5b7d50785ef5bf
BLAKE2b-256 checksum
How to use checksums
742db6ae0656ff5dc2ec7d2584a831b9185113d3178c8eb7880efdb35b6ca31e
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