Repository Classes
There are a few basic python classes you can use to interact with Oxen repositories. The full list of Python APIs can be found in the API Documentation.Remote vs Local
Oxen has the concept of Remote Repositories and Local Repositories. One of the core tenets of Oxen is that data should feel like it is local, even if it is not. Hence the APIs for Local vs Remote are very similar, the only difference is where you are performing the operation.Remote Repositories
Remote Repositories only download pointers and metadata, so that you can interact with the data as if it was local. Here is the full documentation for the RemoteRepo.Integrate with Pandas
The fastest way to integrate Oxen into your existing workflow is to use the fact that Oxen gives you direct access to files and directories given a specific revision. For example, let’s load a data file given a specific commit into PandasPython
https://hub.oxen.ai/api/repos/:namespace/:repo_name/file/:revision/:file_path
Python
Add Files
Oxen has the concept of Remote Workspaces that make it easy to add data to a remote repository without ever downloading it locally.Python
Local Repositories
(Local) Repos have all the files versioned and accessible on your local machine. They duplicate the data between your working directory and a hidden .oxen directory so that you can quickly swap between versions and run experiments. If you are creating a new repository from scratch, this is a great place to start. The workflow is very similar to git in terms of initializing a repository, adding data, committing, and pushing to a remote. Let’s walk through some basic operations.Init
Assuming you are creating a brand new repository, first you will have to create an empty directory, point yourLocalRepo
to it and run init()
.
Add Files
Now let’s create a README.md file and add it to the local staging area.[README.md]
Commit Staged Files
With your README.md staged you can now commit with a messageConfigure Remote
The easiest way to create a remote is in the Oxen Hub web interface.