MT005: HasKeywords
Overview
| Property | Value |
|---|---|
| ID | MT005 |
| Name | HasKeywords |
| Group | metadata |
| Severity | WARNING |
Description
Checks that the [project].keywords field is defined in pyproject.toml.
Keywords improve package discoverability by:
- Enabling search on PyPI
- Helping users find related packages
- Categorizing your package by topic
What it checks
The check verifies that pyproject.toml contains:
[project]
keywords = ["keyword1", "keyword2", "keyword3"]How to fix
Add the keywords field to your pyproject.toml:
[project]
keywords = ["cli", "testing", "packaging", "pypi"]Choosing good keywords
- Use lowercase, single words or short phrases
- Include common synonyms users might search for
- Cover the domain/topic of your package
- Include technology stack where relevant
- Aim for 5-10 relevant keywords
Good examples:
# For a data processing library
keywords = ["data", "pandas", "csv", "etl", "pipeline", "dataframe"]
# For a web framework
keywords = ["web", "http", "api", "rest", "async", "server"]
# For a CLI tool
keywords = ["cli", "command-line", "terminal", "automation"]Avoid:
- Overly generic terms (“python”, “library”)
- Unrelated popular keywords (keyword stuffing)
- Duplicates of your package name
- Excessive keywords (more than 15-20)
Configuration
Skip this check
[tool.pycmdcheck]
skip = ["MT005"]CLI
pycmdcheck --skip MT005