pyproject.toml Generator
Generate a complete, commented PEP 621 pyproject.toml.
Input
1 line · 10 charsResult
22 lines · 405 charsPyproject Generator turns form fields into a complete, commented pyproject.toml. Pick a build backend and the emitted build-system and tool sections follow it; fill in PEP 621 project metadata, dependencies, optional-dependency groups and console scripts, and toggle pytest, ruff, mypy or coverage sections. The output is checked for TOML validity before you copy or download it, and per-line dependency validation catches malformed PEP 508 requirements.
Examples
backend=setuptools, name=demo[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"Every generated file starts with the correct build-system table.
dependencies: requests>=2, clickdependencies = [
"requests>=2",
"click",
]Requirements are emitted as a TOML array, one per line.
script: mycli = mypkg.cli:main[project.scripts]
mycli = "mypkg.cli:main"Console scripts map names to module:function entry points.
About this tool
Python packaging moved from setup.py to pyproject.toml, but the PEP 621 table syntax is easy to get subtly wrong. This generator starts from a form and emits a valid, commented file you can adapt rather than a fragment you have to assemble.
Choosing a backend matters: setuptools, hatchling, poetry-core, flit_core and pdm-backend each use different build-backend strings and different tool sections. The generator keeps those in sync so the emitted file is internally consistent.
Validation is part of the workflow. Dependency lines are checked as PEP 508 requirements and the assembled document is checked for TOML syntax basics before the download button is enabled.
What this tool does not do
- The TOML check is a structural self-check, not a full TOML parser implementation.
- The setup.py import helper reads simple literal assignments only; dynamic values and function calls need manual review.
- Backend-specific options beyond the emitted starter sections are out of scope.
How to use this tool
Pick a backend
Choose setuptools, hatchling, poetry-core, flit_core or pdm-backend. The tool sections below adapt to that choice.
Fill in metadata
Set name, version, description, readme, requires-python, authors, license, keywords, classifiers and URLs.
Add dependencies
Enter one PEP 508 requirement per line and create optional-dependency groups such as dev or test. Console scripts use name = module:function.
Copy or download
Review the commented TOML preview, fix any flagged lines, then copy or download pyproject.toml.
Use cases
Start a new library
Generate a correct PEP 621 skeleton with the backend and tool sections already wired up.
Migrate from setup.py
Carry name, version and install_requires into a modern pyproject.toml without hand-writing table syntax.
Standardize templates
Create a consistent starting file for internal packages with the same tool configuration across teams.
Build backends
| Backend | build-backend |
|---|---|
| setuptools | setuptools.build_meta |
| hatchling | hatchling.build |
| poetry-core | poetry.core.masonry.api |
| flit_core | flit_core.buildapi |
| pdm-backend | pdm.backend |
Poetry 2.x supports PEP 621 directly; the emitted note explains the legacy [tool.poetry] alternative.
Common mistakes
Mistake:Mixing the wrong build-backend with tool sections.
Fix:Keep the backend selector authoritative: the emitted [build-system] and the conditional [tool.*] table always match.
Mistake:Putting requirements.txt content into optional-dependencies by accident.
Fix:Core runtime dependencies belong in project.dependencies; only extra groups such as dev or test go under [project.optional-dependencies].
Mistake:Using setuptools without a version constraint.
Fix:PEP 621 metadata support needs a modern setuptools; the emitted requires includes a lower bound.
Frequently asked questions
Which backend should I choose?
Hatchling and flit_core are light and good for most pure-Python libraries. setuptools is the safest default when you need broad tooling compatibility or package data. poetry-core and pdm-backend fit projects already using those workflows. The generator emits the matching build-system and tool sections for whichever you pick.
Where do requirements go now?
Runtime requirements go into the dependencies array under [project] as PEP 508 strings. Development, test and documentation requirements go into [project.optional-dependencies] groups, which users install with syntax like pip install "myproj[dev]".
What is [project.scripts]?
It maps command names to callable entry points, for example mycli = "mypkg.cli:main". Installing the package then creates a mycli command. Use [project.gui-scripts] for GUI launchers.
Do I still need setup.py?
Usually not. With PEP 621 metadata and a build backend that supports it, setup.py can be removed. Some legacy workflows still read it, so keep a shim only if a tool in your pipeline actually requires one.
How do optional-dependencies groups work?
Each group is a key under [project.optional-dependencies] mapped to a list of requirement strings, such as dev = ["pytest>=8", "ruff"]. Consumers install a group with the extras syntax: pip install "package[dev]".
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.