Getting Started
Build, test, document, and ship Python, Rust, Zig, npm, and web projects fast
fastship builds on ideas from nbdev and Quarto in one tool for building, testing, documenting, and releasing Python libraries (notebooks, plain .py, or hybrid), Rust/maturin workspaces, Rust crates, Zig CFFI packages, npm packages, documentation sites, and blogs.
Write notebooks, .py modules, Markdown, or .qmd freely in one repo — with no Quarto or Jupyter server required for docs or tests.
- Built-in static sites & blogs rendered directly in Python with
mdhtmland Pagefind search, RSS feeds, Markdown (.md) copies,llms.txt, automatic symbol doclinks, and one-command GitHub Pages setup (ship-pages) - Unified testing (
ship-test) running notebook lessons, literate.py```{python}docstring examples (execnb.minipy), andpytestin one command - Fast local & CI releases using
uv buildanduv publishlocally for pure Python packages, and tag-triggered GitHub Actions CI for Rust/maturin, Zig, and npm - Flexible authoring mixing plain
.pymodules, literate Jupyter notebooks (with cell-ID two-wayship-syncto your editor), Markdown, and.qmdin the same repo - Git-friendly notebooks with
ship-clean,ship-diff/ship-diff-driver, andship-mergestripping metadata noise and resolving merge conflicts cleanly - One TOML config (
ship.tomlor[tool.fastship]inpyproject.toml, optional when defaults suffice) while packaging metadata stays in native manifests
Install
fastship works on macOS, Linux, and Windows (WSL). Install with uv or pip:
uv pip install fastship
Create a new project in seconds:
ship-new my-project # plain Python package
ship-new my-project --nb # Python package with starter notebooks in ship/
ship-new my-project --kind maturin # Rust/PyO3 Cargo workspace (add --nb for hybrid)
ship-new my-project --kind crate # pure Rust crate
ship-new my-project --kind zig # Zig-backed CFFI Python package
ship-new my-site --kind site # standalone website or blog with ship.toml
Inside a project, the core loop is:
ship-export # export notebooks + refresh _modidx.py and generated README.md
ship-test # run notebook lessons, literate .py examples, and pytest
ship-preview # build and live-preview docs at http://localhost:8000
ship-release # changelog, publish (local uv or tag CI), and version bump
How to use fastship
Learn the workflow with the written walkthrough, or watch the walkthrough video recorded for fastship's predecessor nbdev:
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/l7zS8Ld4_iA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="max-width: 100%; margin: auto; border-radius: 10px"></iframe>
Alternatively, there's a shortened version of the video walkthrough with coding sections sped up using the unsilence Python library – it's 27 minutes faster, but a bit harder to follow.
Run ship-help from the terminal to see the full list of available commands:
!ship-help
ship-bump Bump the authoritative project version in place and sync configured `version-files`.
ship-changelog Create or update `CHANGELOG.md` from closed labeled GitHub issues since the last release.
ship-clean Clean all notebooks in `fname` to avoid merge conflicts
ship-diff Cell-level diffs for changed notebooks between two git refs
ship-diff-driver Git external diff driver for notebooks and plain text files
ship-docs Build a documentation website or standalone site and report unresolved links.
ship-export Export notebooks to Python modules and refresh tracked generated files (`_modidx.py` and generated `README.md`/`CONTRIBUTING.md`)
ship-fix Create working notebook from conflicted notebook `nbname`
ship-gh Update `CHANGELOG.md`, optionally edit it, commit and push tracked changes, and create a GitHub release.
ship-help Show help for all `fastship` console scripts.
ship-llms Print or write generated `llms.txt` (and companion files with `--out`) for a project.
ship-merge Git merge driver for notebooks
ship-migrate-quarto Convert a Quarto or Quarto-nbdev project to Fastship in place; commit or back up first
ship-new Create a new `fastship` project or standalone site.
ship-npm-init Configure an existing Python+npm or npm-only project for tag-triggered OIDC releases via GitHub Actions.
ship-pages Configure GitHub Pages Actions docs deployment and enable Pages on the GitHub repository.
ship-pr Create a pull request from uncommitted or unpushed work, squash-merge it, and reset the default branch.
ship-prepare Export tracked artifacts, run `ship-test`, and clean notebooks.
ship-preview Build and preview a documentation website or standalone site.
ship-pypi Build distributions with `uv build --clear` and upload with `uv publish` without bumping the version.
ship-readme Render `README.md` or `CONTRIBUTING.md` as GitHub Markdown using the site's notebook execution policy.
ship-release Run the release workflow for the current project, then bump and push the version.
ship-rs-build Build a maturin/PyO3 wheel through `uv build --wheel` and the configured PEP 517 backend.
ship-rs-init Configure an existing maturin/PyO3 project's `pyproject.toml` for `fastship` without modifying application source files.
ship-sync Propagate changes in exported `.py` modules matching `fname` to the notebooks that created them
ship-test Run notebook tests, literate `.py` module tests, and `pytest` (when `tests/` or `testpaths` is present).
ship-watch Watch notebooks in `ship_dir` and re-export the changed module on save.
ship-zig-build Build the current platform wheel for a `fastship` Zig project (`ziglang` in `[build-system].requires`) via `uv build --clear --wheel`.
FAQ
Q: What is the warning "Found a cell containing mix of imports and computations. Please use separate cells"?
A: You should not have cells that are not exported, and contain a mix of import statements along with other code. For instance, don't do this in a single cell:
import some_module
some_module.something()
Instead, split this into two cells, one which does import some_module, and the other which does some_module.something().
Only top-level statements count: try: import blocks and imports inside function definitions are fine.
The reason for this is that when we create your documentation website, we ensure that all of the signatures for functions you document are up to date, by running the imports, exported cells, and show_doc functions in your notebooks. When you mix imports with other code, that other code will be run too, which can cause errors (or at least slowdowns) when creating your website.
Q: Someone told me not to use notebooks for "serious" software development!
A: Watch this video. Don't worry, we still get this too, despite having used nbdev and fastship across a wide range of production software projects including deep learning libraries, API clients, Python language extensions, web frameworks, and more!
Contributing
If you want to contribute to fastship, review the contribution guidelines and see Git-Friendly Jupyter to configure the notebook diff and merge drivers.
Copyright
Copyright © 2019 onward fast.ai, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project's files except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.