codemod-tox
Utilities for editing tox.ini
What it is and what it does
codemod-tox is a utility library for programmatically reading and modifying tox.ini configuration files. It provides parsers for tox environment lists, individual environment definitions, and conditional dependency specifications, allowing you to construct, expand, and transform these configurations as Python objects rather than manipulating raw strings.
The library is designed for tools that need to analyze or rewrite tox configurations—such as linters, migration scripts, or test infrastructure generators. It has no runtime dependencies and installs with low friction. It requires Python 3.10 or later and follows semantic versioning with a commitment to rename on major version changes.
Use it for:
- Automatically expand or filter tox environment matrices in CI/CD pipeline configuration scripts
- Build linting or validation tools that need to parse and understand tox.ini structure
- Generate or modify tox configurations programmatically in test infrastructure generators
- Migrate or refactor tox configurations across multiple projects using codemod-style transformations
- Analyze tox environment dependencies to detect conflicts or redundancies
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and modifies tox.ini configuration strings, including environment lists, environment definitions, and conditional dependencies with support for expansion and transformation.
Yes, if you need to parse or modify tox.ini files programmatically. The package is actively maintained, has no dependencies, installs easily, carries a permissive MIT license, and requires only Python 3.10+. It is well-suited for build tools, CI scripts, and configuration management. Not necessary if you only read tox.ini manually or use tox itself without programmatic modification.
Install
codemod-tox on PyPI
pip
pip install codemod-toxuv
uv add codemod-toxpoetry
poetry add codemod-toxInstalling codemod-tox
Before you install
Low friction install with no runtime dependencies. Active maintenance with recent release; last commit on 2026-04-16. Requires Python 3.10+.
License in practice
MIT license permits commercial and private use with minimal restrictions; attribution required.
Quickstart
from codemod_tox import ToxEnv, ToxEnvlist
# Parse and expand environment definitions
env = ToxEnv.parse("py37") | "py38"
print(list(env)) # ["py37", "py38"]
# Parse and transform environment lists
envlist = ToxEnvlist.parse("py37, style")
result = envlist.transform_matching(
lambda x: x.startswith("py3"),
lambda y: y | "py38"
)
Requires Python 3.10 or later.
Verify before relying
- Whether the package handles all tox.ini syntax variations or only basic cases as described
- Performance characteristics when processing large or complex tox configurations
- API stability guarantees beyond the meanver/semver promise mentioned in the description
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 120 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 182,940/month — #10,080 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: codemod_tox-0.5.4-py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
codemod-yamlModifies YAML documents in place with surgical…
permissive · top 15,000 on PyPI
tox-gh-actionsA tox plugin that automatically detects and…
permissive · top 15,000 on PyPI
conditionalConditionally apply a context manager to a code…
permissive · top 15,000 on PyPI
parameter-expansion-patchedExpands POSIX and Bash shell parameter syntax…
permissive · top 15,000 on PyPI
dparse2Parses Python dependency manifests…
permissive · top 15,000 on PyPI
tox-ghtox-gh automatically selects and runs the…
permissive · top 15,000 on PyPI
INIToolsINITools parses and manipulates INI-style…
permissive · top 15,000 on PyPI
bracexBracex expands Bash-style brace patterns into…
permissive · top 1,000 on PyPI
pyconfiguratorParses command-line arguments and INI…
permissive · top 15,000 on PyPI
oslo.configParses command-line arguments and .ini-style…
permissive · top 5,000 on PyPI