Skip to main content

Data version control for machine learning

Project description

🐂 🐍 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 🔨

Pre-Requistes

If you're developing the Python interface, you'll need to:

  1. Install the Rust toolchain
  2. Install uv
  3. Install the pre-commit hooks to ensure your code is consistent

Development Cycle

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 .

Project details


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.46.1-cp311-cp311-manylinux_2_34_x86_64.whl (52.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

oxenai-0.46.1-cp311-cp311-manylinux_2_34_aarch64.whl (50.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

oxenai-0.46.1-cp311-cp311-macosx_11_0_arm64.whl (44.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

oxenai-0.46.1-cp311-cp311-macosx_10_13_x86_64.whl (48.6 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

oxenai-0.46.1-cp310-cp310-win_amd64.whl (45.5 MB view details)

Uploaded CPython 3.10Windows x86-64

oxenai-0.46.1-cp310-cp310-manylinux_2_34_x86_64.whl (52.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

oxenai-0.46.1-cp310-cp310-manylinux_2_34_aarch64.whl (50.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

oxenai-0.46.1-cp310-cp310-macosx_11_0_arm64.whl (44.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

oxenai-0.46.1-cp310-cp310-macosx_10_13_x86_64.whl (48.6 MB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

File details

Details for the file oxenai-0.46.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 37910f8d18be8ca6dd273d7b507bc0a4809b93027f8501ddda165f97f5f78895
MD5 3001708702cae31cbd5fe4ff7a3ec3be
BLAKE2b-256 7ecb794a3f93a8afefd8109b66737266119136bf0a3494defe6e6b345b9a0ae9

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fc081aa25d68de6c1a19e52d2a7cf07774762244ea6dd6b1f2290c69e4029fa1
MD5 31b6d60f70714c73e6ac8053d7883b0a
BLAKE2b-256 3d4cb5a6edef64208d2280082178c33c09a6d47f26b5892144e82fc2b790db30

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4d2690c8dcc7ff89985475e870b86174a222177d29f5ba5ba66c0a41f51ebe4
MD5 5fed84d11585b6693d632f398eaaf01d
BLAKE2b-256 f9c3dc52c490b7cfcbe922f25ee6245a4ac13857de862bef9c10c5070dbe8ed1

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0c1106ac2a42236ec23174af422b2ea73343737f32e9ee8e633b1d0f16430f1e
MD5 e520390433c17ca5d34ed63b1223b9e5
BLAKE2b-256 5ed1523d75f95b34ba222d717c9bf320fd13b332223c54b352cbad9c5652bb3a

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: oxenai-0.46.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 45.5 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.4

File hashes

Hashes for oxenai-0.46.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 27c825b7b0ca4c02b414a33bfcabfb5cb2d432ae714096b5bec06d893f9430d4
MD5 5f8242d9787d72a451c627b59c8bd901
BLAKE2b-256 8a391237571b6e3f23da82f66a698b0d680ec54b5248bd8b51cbe1593e2b5102

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9c642b7ece49befce6c75833a1d886e50ac08a623050c9cc50a3efd70cb06f6a
MD5 c1433fbaf99713aa3e1cb91850964231
BLAKE2b-256 2b7c22640bb46092d1ab3b4141050b032e21048d33cd64a2a77d49a48372bf53

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3981193ec508770df81e6183d82cc538f205f0d9b43275a0800d68c291f795f3
MD5 79e4934de8a2310610e441b5e29ca619
BLAKE2b-256 79e9e7eab47cfae0f51071164ef8d8354827388a05ec77b805c4c3cd5952db68

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d32ed775ccdf750480dfab6960a1bf1272051beb12a5a71a09a820332bd9aef0
MD5 d77f957d060a597c4357d6dfbb621ad7
BLAKE2b-256 f141c1bbc03fae020370a6b1df5b36fd938a130eb3434d0c6eef40841ef3550d

See more details on using hashes here.

File details

Details for the file oxenai-0.46.1-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for oxenai-0.46.1-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 703e6213f68f1e48d25f54df6a413a01d1146ebc6bb838bb77304e41ffd1b3fc
MD5 55148f61beb52c177a79e5a29bbc5817
BLAKE2b-256 77b47a5c9907b6532463b81486a77ebf4ee7dd755aeb98d78d506c9b4d1d18b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page