Install
Clone Repository
Clone a repository from the Oxen Hub or your own oxen-server. Detailed documentation for the clone method can be found in the Module Reference below.SpanishToEnglish in your current working directory and download the latest version of the repository.
If you have not setup your API Key locally, you will get an error cloning data. View our Authentication & Authorization documentation to learn more.
Initialize Local Repository
If you are creating a new repository from scratch, you can initialize it with the init method. We will be using a fictional repository calledCatsVsDogs for this example.
.oxen directory to keep track of changes as you make them.
Load Existing Repository
Use the repo class to interact with a repository that has already been initialized.Add Files
Now letβs create a README.md file and add it to the local staging area. This will not commit the changes to the repository, but it will prepare them to be committed.Commit Changes
Now that we have added the README.md file to the staging area, we can commit the changes to the repository.Diff Changes
Oxen.ai has powerful diff tools built in that allow you to see the changes to files between commits, branches, and more.Push To Remote
Itβs one thing to version your data locally, but where the real power comes in is when you can share your data with others. Oxen repositories can be pushed to a remote repository hosted on Oxen Hub or your own oxen-server. There are a few steps when pushing to a remote for the first time.Create Remote
Before you can push to a remote repository, you must create it. This can be done with the create_repo method.Point Local to Remote
Now that we have created the remote repository, we need to point our local repository to sync to it. This can be done with the set_remote method.Push Changes
Now that we have created the remote repository and pointed our local repository to it, we can push our changes to the remote repository.Full Push Example
The end to end workflow from scratch looks like this:Pull Data
Now that we have pushed our changes to the remote repository, we can pull them down to another machine.OxenFS (fsspec Integration)
OxenFS allows you to conveniently read and write files through a Pythonic file interface.Branching
Branching is a powerful feature of Oxen that allows you to create a named version of your data without affecting the original version. This is useful when you want to experiment with your changes affecting the original version.Create Branch
To create a new branch, use the Repo.checkout method.oxen checkout -b add-dogs).
List Branches
To list all of the branches in a repository, use the Repo.branches method.main branch and a add-dogs branch, each tied to a commit id. The commit ids will be the same at this point, because the branches have not diverged in content.
Module Reference
Detailed documentation for each Python module.Clone
clone is used to download a repository to your local machine.Initialize Repository
init is used to initialize a new local repository.Configure User
user is used to configure the user for a local repository.Setup Auth
auth is used to configure authentication for remote repositories.Repositories
The Repositories page has an overview of the two repository classes, and detailed documentation for each class can be found on their respective pages below.- Repo is used to interact with data locally.
- RemoteRepo is used to interact with a remote data without downloading all of it locally.