Skip to main content

colab-repoclone

Code style: black

Outline

This Python package handles Git integration in Google Colab. Using GitHub credentials established as either environment variables (via the colab-env package) or directly by standard input, this package will clone a specified repository into your local Google Colab environment. It then allows for modification of the files inside and ulimately provides push capability back to GitHub directly from Colab.

As of v0.2.0, this package also allows one to: - Create a local directory from scratch and initialize it as a GitHub repository. - Create new branches and checkout existing branches - Perform a hard reset back to a previous commit

Usage

To load GitHub functionality for pushing and pulling to private repositories using colab-repoclone you should include the following code at the top of your Colab notebook:

!pip install colab-repoclone -qU
import colab_repoclone

Then, to create a copy of a desired repository, run the following:

your_repo_name = colab_repoclone.local_repository(your_repo_url)

To initialize a new repository, run:

your_repo_name = colab_repoclone.local_repository(your_repo_url, clone=False)

local_repository also includes some optional keywords for specifying where to look for GitHub credentials and whether to pull a single branch of a repository.

Now you can run any of the methods in the LocalRepo class as desired by referencing your_repo_name, such as your_repo_name.push().

Take it for a test-drive

Simply open up colab-git/colab_repoclone_testbed.ipynb in Google Colab and try it out!

Contributors

Jordan Lueck (jordan.lueck@apolitical.co)

(with thanks to Paddy Alton (paddy.alton@apolitical.co) for assistance and review)

Metadata

Release files for colab-repoclone 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colab-repoclone 0.2.3
File Size Uploaded Provenance
colab_repoclone-0.2.3.tar.gz 6.7 kB Without provenance Details

Release files / colab_repoclone-0.2.3.tar.gz

Download URL colab_repoclone-0.2.3.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6393695460527fbac74dd6e2fb382ebe2123c288b110ba52c2525220c3d3181e
BLAKE2b-256 checksum
How to use checksums
743272211c92df557e10aaa610ed7a5e172845f28b39282a58b090057e0c3b69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Security for colab-repoclone 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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