Skip to main content

repo2nb CLI

repo2nb

License: MIT Release Made with Python PyPI downloads

repo2nb CLI is an open-source Python CLI tool that converts a local code repository into a self-contained Jupyter notebook (.ipynb) designed natively to run on Kaggle's free GPU environment... and now Google Colab too.

Video Tutorial

repo2nb Quick Start Guide

Motivation

This is a tool I made for personal use first, then I wanted to publish it.

My motivation was that I wanted to securely run a training repo on Kaggle, but it was scattered across directories and Python files. It is extremely frustrating copying all of this into a notebook and debugging why it's giving an error.

I used to do workarounds like uploading the repo as a dataset and starting from there. It was exhausting and wasted a couple of minutes just to realize I missed an indented line! Attempting the same flow manually using git for authenticating myself, pushing, and pulling for simple microscopic changes, which was equally painful. repo2nb automates all of this seamlessly.

Installation

pip install repo2nb

Usage

# Convert your local project into a Kaggle-ready notebook
python -m repo2nb ./my_project --output my_project_kaggle.ipynb

Then literally just upload the resulting .ipynb file to Kaggle!

That's the whole idea: one command turns your file tree into a notebook that rebuilds your repo on a free GPU machine, installs your dependencies, and comes pre-wired with secure git auth so you can pull and push from the platform.

What you get

  • Instant Rebuild: Automatically translates your local file tree into correctly ordered %%writefile blocks.
  • Git Integration: Injects pre-formatted shell cells for initializing Git, adding tokens, selecting branches, pulling, and pushing.
  • Smart Filtering: Automatically skips cached data, virtual environments (.venv), lock files, heavy binaries (.pt, .pkl, .jpg), and dataset files (.csv, .parquet) so your final notebook remains incredibly lightweight.
  • Dependency Auto-Detection: Resolves dependencies from poetry, uv, requirements.txt, or your actual imports — and emits one plain pip install cell.
  • Reverse Mode: Reconstruct your local repo from a generated notebook (repo2nb reverse), closing the loop on Kaggle-side edits.
  • Incremental Sync: Update an existing notebook in place after local changes (repo2nb sync) instead of regenerating from scratch.
  • Multi-Target: Generate for Kaggle (default) or Google Colab (--target colab).
  • Visual Segregation: Creates unmissable structural phases isolating where the automatic repo build ends and where your actual coding workspace begins.
  • Built-in Git Cheat Sheet: Gives you immediate interactive access to git status, git rm -rf, and git mv blocks directly in the UI.

Learn more

Doc Contents
TUTORIAL.md Every command and flag, dependency detection, .repo2nbignore, reverse & sync workflows, Colab setup, conventions
SECURITY.md How secrets are handled and what the tool writes to your machine
SUPPORT.md Getting help and reporting bugs
CONTRIBUTING.md Development setup, project layout, PR guidelines

Reporting Issues

Found a bug or have a feature request? Head over to SUPPORT.md for how to report it well.

Metadata

Release files for repo2nb 0.2.1

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

Source distribution (sdist)

Source distribution for repo2nb 0.2.1
File Size Uploaded Provenance
repo2nb-0.2.1.tar.gz 207.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for repo2nb 0.2.1
File Interpreter ABI Platform
repo2nb-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 227.4 kB

Release files / repo2nb-0.2.1.tar.gz

Download URL repo2nb-0.2.1.tar.gz
Size 207.4 kB
Tags Source
SHA-256 checksum
How to use checksums
24e77141f472dc966b33fb6a60e8e32c24413f03a94d80afd59df985b61dfc93
BLAKE2b-256 checksum
How to use checksums
19c0d9f43df8605b88a7f61218c13a9b6ffd6e801dc33416f35caa78c012c0be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / repo2nb-0.2.1-py3-none-any.whl

Download URL repo2nb-0.2.1-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c8fe83af081cd44ffc7ac67176e0cda5aea298c0d51114cf02f8b958acfcb89
BLAKE2b-256 checksum
How to use checksums
c60b6a308ab408246b9aadb1e477123c6ad827258d71c62f69cade259f9452bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for repo2nb 0.2.1

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