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 = 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.

Project details


Download files

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

Source Distribution

oxenai-0.17.0.tar.gz (157.0 kB view hashes)

Uploaded Source

Built Distributions

oxenai-0.17.0-cp312-none-win_amd64.whl (30.3 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

oxenai-0.17.0-cp312-cp312-manylinux_2_35_x86_64.whl (41.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.35+ x86-64

oxenai-0.17.0-cp312-cp312-manylinux_2_31_x86_64.whl (41.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.31+ x86-64

oxenai-0.17.0-cp312-cp312-macosx_13_0_x86_64.whl (34.7 MB view hashes)

Uploaded CPython 3.12 macOS 13.0+ x86-64

oxenai-0.17.0-cp312-cp312-macosx_11_0_arm64.whl (31.5 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

oxenai-0.17.0-cp311-none-win_amd64.whl (30.3 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

oxenai-0.17.0-cp311-cp311-manylinux_2_35_x86_64.whl (41.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.35+ x86-64

oxenai-0.17.0-cp311-cp311-manylinux_2_31_x86_64.whl (41.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.31+ x86-64

oxenai-0.17.0-cp311-cp311-macosx_13_0_x86_64.whl (34.7 MB view hashes)

Uploaded CPython 3.11 macOS 13.0+ x86-64

oxenai-0.17.0-cp311-cp311-macosx_11_0_arm64.whl (31.5 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

oxenai-0.17.0-cp310-none-win_amd64.whl (30.3 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

oxenai-0.17.0-cp310-cp310-manylinux_2_35_x86_64.whl (41.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.35+ x86-64

oxenai-0.17.0-cp310-cp310-manylinux_2_31_x86_64.whl (41.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.31+ x86-64

oxenai-0.17.0-cp310-cp310-macosx_13_0_x86_64.whl (34.7 MB view hashes)

Uploaded CPython 3.10 macOS 13.0+ x86-64

oxenai-0.17.0-cp310-cp310-macosx_11_0_arm64.whl (31.5 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

oxenai-0.17.0-cp39-none-win_amd64.whl (30.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

oxenai-0.17.0-cp39-cp39-manylinux_2_35_x86_64.whl (41.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.35+ x86-64

oxenai-0.17.0-cp39-cp39-manylinux_2_31_x86_64.whl (41.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.31+ x86-64

oxenai-0.17.0-cp39-cp39-macosx_13_0_x86_64.whl (34.7 MB view hashes)

Uploaded CPython 3.9 macOS 13.0+ x86-64

oxenai-0.17.0-cp39-cp39-macosx_11_0_arm64.whl (31.5 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

oxenai-0.17.0-cp38-cp38-manylinux_2_31_x86_64.whl (41.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.31+ x86-64

Supported by

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