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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

oxenai-0.56.0-cp311-abi3-win_amd64.whl (30.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

oxenai-0.56.0-cp311-abi3-manylinux_2_34_x86_64.whl (30.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

oxenai-0.56.0-cp311-abi3-manylinux_2_34_aarch64.whl (29.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ ARM64

oxenai-0.56.0-cp311-abi3-macosx_11_0_arm64.whl (28.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

oxenai-0.56.0-cp311-abi3-macosx_10_13_x86_64.whl (31.4 MB view details)

Uploaded CPython 3.11+macOS 10.13+ x86-64

File details

Details for the file oxenai-0.56.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: oxenai-0.56.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 30.2 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.4

File hashes

Hashes for oxenai-0.56.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 57ecd35a8b6b5b2634c6afa4ac2a9b0110756891f2ef8366e14baed3782b13c3
MD5 67df9b104ad6367812526b31012e4b7d
BLAKE2b-256 7f0a32b33cf747e251b4609dd4d2dcd6587b63f770cb4e3c7d86431d662342bb

See more details on using hashes here.

File details

Details for the file oxenai-0.56.0-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.56.0-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e448307bd85151f838389d26b873340220d8acb425cf09f201958a202e228ebb
MD5 ec9485b2b8597d19aa1313d9beeb40bf
BLAKE2b-256 36627ad40d6aea80cecb7ed23344b8d09198781388debde14e2f35f709bc71d2

See more details on using hashes here.

File details

Details for the file oxenai-0.56.0-cp311-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for oxenai-0.56.0-cp311-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 f66c6d9c4d0fd84dcf29fcc7f32aaef97e6d1fc5ce17c47b4e82f8aa08856a55
MD5 91f9b19888a890afb7cb97c7ae79063c
BLAKE2b-256 04dc715795491450fc7c7c61c2ada6bc9da5779fe01a3d11583008dc762fc4f6

See more details on using hashes here.

File details

Details for the file oxenai-0.56.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oxenai-0.56.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4853eb84727b6a0e0c2a3c8144a6482425b6429b1062915d2d1a9f44601ca41
MD5 5b793c10c8a281aba954602e6b87663f
BLAKE2b-256 b01a2b1e563fe34b86770d9253c032280649ffb8e1e1a9c9757cdda175d56e7b

See more details on using hashes here.

File details

Details for the file oxenai-0.56.0-cp311-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.56.0-cp311-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f9a1340a6913f00ff78974b21b6f7fe555f5b314e37d0ea09d5e807769994b73
MD5 0b457bdb82be40330acc1ec38840be48
BLAKE2b-256 6231cd479d24eb8cb70f646dbed018b8281b824e2b9e4d72c634e197ef360d63

See more details on using hashes here.

Release history Release notifications | RSS feed

0.56.1

5 files

This release

0.56.0 This release

5 files

0.55.0

5 files

0.53.4

5 files

0.53.3

5 files

0.53.0

5 files

0.52.9

5 files

0.52.6

5 files

0.52.4

5 files

0.52.3

5 files

0.52.2

5 files

0.52.1

5 files

0.52.0

5 files

0.51.5

5 files

0.51.4

5 files

0.51.3

5 files

0.51.2

5 files

0.51.1

5 files

0.50.7

5 files

0.50.6

5 files

0.50.5

5 files

0.50.4

5 files

0.50.1

5 files

0.50.0

5 files

0.49.1

5 files

0.49.0

5 files

0.48.3

20 files

0.48.1

20 files

0.48.0

20 files

0.47.0

20 files

0.46.12

20 files

0.46.9

20 files

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