Suggests classifiers for Python packages.
Project description
troml 🥁
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.
Usage
uvx
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
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
pip --user
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
CLI arguments
path
troml optionally accepts a path as the first argument. Defaults to . for the current directory.
uvx troml /path/to/pypyproject.toml
suggest
Provides an output of suggested classifiers. The default if no other command is used.
uvx troml suggest /path/to/pypyproject.toml
--fix
Automatically add classifiers in the pyproject.toml based on the suggestions. Will not remove existing classifiers.
uvx troml suggest --fix /path/to/pypyproject.toml
--no-multiline
Output the classifiers in a single-line. No-op if used without --fix.
uvx troml suggest --fix --multiline /path/to/pypyproject.toml
check
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
Supported classifiers
Python version
troml will read project.python-requires and suggest classifiers based on it.
License (deprecated)
troml will suggest removing the legacy license classifiers.
Dependencies
troml will suggest classifiers based on the dependencies in project.dependencies, project.dependency-groups, and tool.uv.constraint-dependencies.
Typing
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.
FAQ
Does this add classifiers interactively?
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.
What's with the name?
- 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".
Development
- Install
just: https://just.systems/man/en/packages.html just fetch
Run from source
uv run troml [PATH-TO-PYPROJECT-TOML]
Commands
- 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
Inspiration
- 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
Project details
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 troml-0.4.1.tar.gz.
File metadata
- Download URL: troml-0.4.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71b6ea5dcc503bb31937b05f7a7752076d00052c2a0c963f33a2325d0dc0c4b
|
|
| MD5 |
6450336b61233ad10417ae2e5b61643e
|
|
| BLAKE2b-256 |
89e381d7e78cd1508435f02baea95325342f8e997ee25bfa9104c3d49e64e5ae
|
Provenance
The following attestation bundles were made for troml-0.4.1.tar.gz:
Publisher:
publish.yml on adamghill/troml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
troml-0.4.1.tar.gz -
Subject digest:
d71b6ea5dcc503bb31937b05f7a7752076d00052c2a0c963f33a2325d0dc0c4b - Sigstore transparency entry: 515681533
- Sigstore integration time:
-
Permalink:
adamghill/troml@a660eeded1fb2cefba40bc8eb348b86b65393b11 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/adamghill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a660eeded1fb2cefba40bc8eb348b86b65393b11 -
Trigger Event:
release
-
Statement type:
File details
Details for the file troml-0.4.1-py3-none-any.whl.
File metadata
- Download URL: troml-0.4.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cac2bd3663f03af716c221e795500a9ca85eca6b4e27b816db10c89d04f35905
|
|
| MD5 |
97c63e8945d49e7a541edcd8efcfb5d8
|
|
| BLAKE2b-256 |
843092d5e111c77a89df4267b359a1463e703d47b4e10dc7f33a4b49a2e3252b
|
Provenance
The following attestation bundles were made for troml-0.4.1-py3-none-any.whl:
Publisher:
publish.yml on adamghill/troml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
troml-0.4.1-py3-none-any.whl -
Subject digest:
cac2bd3663f03af716c221e795500a9ca85eca6b4e27b816db10c89d04f35905 - Sigstore transparency entry: 515681539
- Sigstore integration time:
-
Permalink:
adamghill/troml@a660eeded1fb2cefba40bc8eb348b86b65393b11 -
Branch / Tag:
refs/tags/0.4.1 - Owner: https://github.com/adamghill
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a660eeded1fb2cefba40bc8eb348b86b65393b11 -
Trigger Event:
release
-
Statement type: