This page guides you through setting up afterpython in your Python project, from installing prerequisites through running the initialization command and understanding the generated project structure. For detailed information about individual configuration files, see Configuration Files. For CLI command reference, see CLI Commands.
This guide covers:
afterpython and its prerequisites.ap init to bootstrap your project.This page focuses on initial setup. For development workflows, see Development Workflow. For customization options, see Advanced Topics.
Before installing afterpython, ensure you have the following tools installed:
| Tool | Minimum Version | Purpose | Installation |
|---|---|---|---|
| Python | 3.11+ | Core runtime | python.org |
| Node.js | 18+ | Website build system | nodejs.org |
| pnpm | 8+ | Node.js package manager | npm install -g pnpm |
| uv | Latest | Python package manager (recommended) | docs.astral.sh/uv/ |
| Git | Any recent | Version control | git-scm.com |
Optional but recommended:
Sources: README.md6-11 README.md27-28 afterpython/doc/overview.md45-57
uv is the preferred tool for managing afterpython as a development dependency.
mystmd (a core dependency) sometimes has restrictive version constraints for platformdirs and nodeenv. If you encounter resolution errors, add overrides to your pyproject.toml:
Sources: README.md64-71 afterpython/doc/quickstart.md11-25
The following diagram shows the complete initialization sequence when you run ap init:
Sources: afterpython/doc/quickstart.md14-38 afterpython/doc/overview.md27-30
afterpython/ and afterpython/static/.uv as the build backend and sets up project URLs.myst.yml in five content directories: doc/, blog/, tutorial/, example/, and guide/.project-website-template into afterpython/_website/.ci.yml, deploy.yml, and release.yml.ap init-branch-rules.Sources: afterpython/doc/quickstart.md27-38 afterpython/doc/quickstart.md87-92
After running ap init, your project will have the following structure:
| Path | Purpose |
|---|---|
afterpython/ | Main configuration and content directory. |
afterpython/static/ | Static assets (images, logos, thumbnails). |
afterpython/doc/ | Documentation content (MyST/Jupyter). |
afterpython/blog/ | Blog posts (MyST/Jupyter). |
afterpython/_website/ | SvelteKit website template source. |
afterpython/_build/ | Temporary build artifacts. |
.github/workflows/ | GitHub Actions CI/CD workflows. |
Sources: afterpython/doc/quickstart.md29-34 afterpython/doc/quickstart.md47-49 .gitignore199-214
Sources: afterpython/doc/quickstart.md58-68 afterpython/doc/overview.md34-41
For details on specific initialization steps and structure, see the following child pages:
_website directory interact.Sources: afterpython/doc/quickstart.md49 afterpython/doc/quickstart.md74-76
Refresh this wiki