troml
provides a list of potential classifiers that could be added to a Python package.
It supports modern Python packages that use the pyproject.toml
standard (aka PEP 621 and PEP 639). troml
also follows PEP 561 to determine whether a package should be considered typed or not.
uv
is an extremely fast Python package and project manager, written in Rust. uvx
is an alias for uv tool run ...
.
- Install
uv
- Go to a directory with source code for a Python package
uvx troml
pipx
is a way to run install and run Python applications in isolated environments.
- Install
pipx
pipx install troml
- Go to a directory with source code for a Python package
troml
Install troml
to the Python user install directory. More details in the pip docs.
pip install --user troml
- Go to a directory with source code for a Python package
troml
troml
optionally accepts a path as the first argument. Defaults to .
for the current directory.
uvx troml /path/to/pypyproject.toml
Provides an output of suggested classifiers. The default if no other command is used.
uvx troml suggest /path/to/pypyproject.toml
Automatically add classifiers in the pyproject.toml
based on the suggestions. Will not remove existing classifiers.
uvx troml suggest --fix /path/to/pypyproject.toml
Output the classifiers in a single-line. No-op if used without --fix
.
uvx troml suggest --fix --multiline /path/to/pypyproject.toml
Exits with an error code if there are any suggested classifiers. Useful for pre-commit
, CI/CD, etc.
uvx troml check /path/to/pypyproject.toml
troml
will read project.python-requires
and suggest classifiers based on it.
troml
will suggest removing the legacy license classifiers.
troml
will suggest classifiers based on the dependencies in project.dependencies
, project.dependency-groups
, and tool.uv.constraint-dependencies
.
troml
will suggest the "Typing :: Typed" classifier based on the existence of the py.typed
file in the same directory as the pyproject.toml
file.
Nope and it's not something I would add in. Take a look at https://codeberg.org/kfdm/add-classifiers or https://github.com/jvllmr/trove-setup if that's what you are looking for.
- The classifiers for Python are called "Trove classifiers"
- Modern Python packages use TOML for configuration
"trove" 🤝 "TOML"
In a happy coincidence, "trommel" in Dutch means "drum".
- Install
just
: https://just.systems/man/en/packages.html just fetch
uv run troml [PATH-TO-PYPROJECT-TOML]
- unit tests (via
pytest
):just test
- linting (via
ruff
):just lint
- type checking (via
mypy
):just type
- unit test coverage (via
coverage.py
):just coverage
- run 'em all:
just dev
- https://indieweb.social/@adamghill/115174743670090084
- another approach from @kfdm: https://codeberg.org/kfdm/add-classifiers
- post about
add-classifers
: https://paultraylor.net/blog/2025/add-classifiers/ - https://github.com/jvllmr/trove-setup
- https://pypi.org/project/typer/ for creating the CLI