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.

[!NOTE] This project is intended for personal and academic projects. It is specifically designed for students and hobbyists like myself who want to quickly leverage free GPU compute without friction, rather than managing massive corporate repositories with hundreds of nested files!

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.

Download files

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

Source Distribution

repo2nb-0.2.1.tar.gz (207.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repo2nb-0.2.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file repo2nb-0.2.1.tar.gz.

File metadata

  • Download URL: repo2nb-0.2.1.tar.gz
  • Upload date:
  • Size: 207.4 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for repo2nb-0.2.1.tar.gz
Algorithm Hash digest
SHA256 24e77141f472dc966b33fb6a60e8e32c24413f03a94d80afd59df985b61dfc93
MD5 993ed6a0c7627868de178f22bfb51cf5
BLAKE2b-256 19c0d9f43df8605b88a7f61218c13a9b6ffd6e801dc33416f35caa78c012c0be

See more details on using hashes here.

File details

Details for the file repo2nb-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: repo2nb-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for repo2nb-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8fe83af081cd44ffc7ac67176e0cda5aea298c0d51114cf02f8b958acfcb89
MD5 05322f5fc63dadf5e96e17aa506132aa
BLAKE2b-256 c60b6a308ab408246b9aadb1e477123c6ad827258d71c62f69cade259f9452bb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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