nbdevAuto
Unlike most sites in this collection, this one documents an installable library rather than a topic. nbdevAuto exists because the nbdev release cycle is a fixed sequence of commands typed in the same order every time: export the notebooks, run the tests, clean them, bump the version, commit, push, build the docs. Each step is one nbdev call, and forgetting one produces a confusing failure two steps later.
The library collapses that sequence into single-word shell commands. It is what just upload and just full_upload invoke under the hood for every submodule in the parent Knowledge repo.
Install
pip install nbdevAuto # the publish-cycle commands and the helpers
pip install 'nbdevAuto[gh]' # also installs githubkit, which `ghstatus` needs
Requires Python 3.10 or newer.
Use
Every exported function is also a console script, so the common case is a bare word in the terminal at the root of an nbdev project:
upload -m "commit message" # export, test, clean, then add/commit/push
Or import the helpers into a notebook:
from nbdevAuto.functions import download_search_images, classify_images
from nbdevAuto.pdf import PDFreader
Contents
| Page | Covers |
|---|---|
| Functions | Dataset and image helpers: reading a list out of a text file, downloading single images or whole search-driven datasets, verifying and resizing what came back, building the folder layout a classifier expects, running a fastai learner over one image, Kaggle competition and dataset shortcuts, and graph, a graphviz.Digraph subclass preloaded with a rounded, filled style |
| Automate | The command line surface: the prep/commit/push pipeline, the GitHub and PyPI release halves, and the help output that lists them all |
| PDF Reader | PDFreader, a class that converts a PDF through pdf2image and renders page ranges inline when you slice it (pdf[0:5]) |
| GitHub | ghstatus: reading .gitmodules, resolving a token, and asking the GitHub API about every submodule at once - CI runs, Pages deploys, Pages builds, remote main shas - plus the --report and --audit views and the exit codes that keep “absent” apart from “cannot ask” |
| Fleet | fleet: running one command across every submodule of a superproject. A walker that reports only what did work and counts the rest, plus the verbs built on it - upload, push, copy, status, update and sync |
The Command Line Surface
Installing the package puts these on your PATH. Most are ordinary functions in Automate, exposed as scripts through [project.scripts]; ghstatus comes from GitHub and fleet from Fleet.
| Command | Does |
|---|---|
prep |
Bump the version, then export, test and clean the notebooks, refreshing _quarto.yml and the README |
gacp |
git add, commit, and push. Without -m the message is built from the staged paths |
status |
Show the working tree state |
upload |
prep then gacp, the one you actually type |
gitrelease |
Bump the minor version, then tag and create a GitHub release |
piprelease |
Build the sdist and wheel, then upload to PyPI with twine |
release |
gitrelease then piprelease |
ghstatus |
Remote status for every submodule of an nbdev superproject, from the GitHub API. --report for the sync view, --audit to check .gitmodules against the repos the account owns, --json for machine output |
fleet |
Run one command across every submodule: `fleet upload |
h |
Print the list of available commands |
Both prep and upload take -p to choose which version part to increment; it defaults to 2, the patch, so every upload ships a new version.
piprelease is the manual path. Pushing to main publishes to PyPI on its own: publish.yaml runs after CI passes, and skips quietly when the version is already there.
ghstatus needs the gh extra (pip install 'nbdevAuto[gh]'), which brings in githubkit. It is an extra rather than a dependency because githubkit pulls pydantic, httpx and hishel behind it, which is a lot of weight for anyone who only wants upload. Without it the command exits 3 with an install hint rather than a traceback. It takes its token from $GITHUB_TOKEN / $GH_TOKEN, then gh auth token.
Where It Is Used
The parent Knowledge repo’s justfile calls upload once per submodule. just upload runs it only where the working tree is dirty, just full_upload runs it everywhere. That is the main consumer, so a change to automate.py affects the publish path for every site in the collection.
ghstatus is the other half of that loop. upload pushes to 19 repos and then goes blind: whether each repo’s CI passed and whether its Pages deploy actually landed is invisible from the terminal. just ci, just report and just audit in the parent repo are all thin wrappers around this one command, which answers for the whole fleet in about 1.5 seconds instead of 19 browser tabs.
Releases
This package publishes itself. A publish.yaml workflow runs after CI passes on main and uploads to PyPI through Trusted Publishing, so no API token is stored in the repository. It reads __version__ out of nbdevAuto/__init__.py and asks PyPI whether that version already exists: a new version is published, an existing one is skipped without failing the build.
Because upload bumps the patch version on every push, an ordinary commit made with upload ships a release. A plain git commit leaves the version alone and the workflow skips. gitrelease, which bumps the minor version and creates the GitHub release and tag, stays a deliberate manual step.
Not Covered Yet
- No test notebook for the helpers.
03_GitHub.ipynbcarries unit tests for its pure functions, but the dataset and image helpers are exercised only by being used, so a broken one surfaces in a downstream repo rather than here. - Undeclared dependencies.
pyproject.tomldeclaresgraphvizandfastcore, plusgithubkitbehind theghextra. The helpers additionally importfastai,fastbook,fastdownload,PIL,matplotlib,tqdm,pdf2image(with poppler behind it),nbdevandkaggle(which also needs its credentials). All of those are imported lazily inside the function that needs them, so installing the package and running the console scripts still works - only the specific helper you call fails. Install them yourself. core.pyis an empty nbdev stub (a singlefoo) left over from00_core.ipynb, which no longer exists.- The docstrings are one-liners, so the rendered API pages are thin. The notebooks carry the real explanation.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nbdevauto-0.3.68.tar.gz.
File metadata
- Download URL: nbdevauto-0.3.68.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd6cafba2c003f3e8b669c6ea367e823a8c74db9cc76f5f2fab53e5079fac36e
|
|
| MD5 |
713491f1105f66a188bdf937178403c0
|
|
| BLAKE2b-256 |
e8e4124e93e045526278ae4ca9df22f387142d1e6d94936100eb6c9e908786b4
|
Provenance
The following attestation bundles were made for nbdevauto-0.3.68.tar.gz:
Publisher:
publish.yaml on bthek1/nbdevAuto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdevauto-0.3.68.tar.gz -
Subject digest:
fd6cafba2c003f3e8b669c6ea367e823a8c74db9cc76f5f2fab53e5079fac36e - Sigstore transparency entry: 2601381597
- Sigstore integration time:
-
Permalink:
bthek1/nbdevAuto@f04290238bfdae5214b98f64cf417373b26fe7d1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bthek1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f04290238bfdae5214b98f64cf417373b26fe7d1 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file nbdevauto-0.3.68-py3-none-any.whl.
File metadata
- Download URL: nbdevauto-0.3.68-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11d4cfaab940af54c5a7b3258c9f805bc51d77e1e124aa45c7f25d7e96c17acc
|
|
| MD5 |
78eeefa01182b46d09f2d0cc453f0dbe
|
|
| BLAKE2b-256 |
93047595dbf5ec55c9e143a808ee985450de73f8262bed17282add69cf8fe7da
|
Provenance
The following attestation bundles were made for nbdevauto-0.3.68-py3-none-any.whl:
Publisher:
publish.yaml on bthek1/nbdevAuto
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nbdevauto-0.3.68-py3-none-any.whl -
Subject digest:
11d4cfaab940af54c5a7b3258c9f805bc51d77e1e124aa45c7f25d7e96c17acc - Sigstore transparency entry: 2601382022
- Sigstore integration time:
-
Permalink:
bthek1/nbdevAuto@f04290238bfdae5214b98f64cf417373b26fe7d1 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bthek1
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@f04290238bfdae5214b98f64cf417373b26fe7d1 -
Trigger Event:
workflow_run
-
Statement type: