This release is a pre-release and may not be stable for production use.
plone-codemod
Automated code migration tool for upgrading Plone add-ons and projects from Plone 5.2 to Plone 6.x.
Unlike simple sed/find scripts, plone-codemod uses libcst (a concrete syntax tree parser) to correctly handle multi-line imports, aliased imports, mixed imports, and scoped usage-site renaming.
What it covers:
- 129+ Python import rewrites with usage-site renaming
- ZCML dotted-name updates
- GenericSetup XML interface and view replacements
- Page template fixes (
here/tocontext/,main_templateto@@main_template) - Bootstrap 3 to 5 migration (opt-in)
- PEP 420 namespace package migration (opt-in)
setup.py/setup.cfgto PEP 621pyproject.tomlconversion (opt-in)- 35+ semgrep audit rules for issues needing manual attention
Installation
pip install plone-codemod
# Or with uv
uv pip install plone-codemod
# Optional: for audit phase
pip install plone-codemod[audit]
Quick Start
# Preview what would change (no files modified)
plone-codemod /path/to/your/src/ --dry-run
# Apply all default migrations
plone-codemod /path/to/your/src/
# Include Bootstrap 3 to 5
plone-codemod /path/to/your/src/ --bootstrap
# Full modernization (namespace packages + pyproject.toml)
plone-codemod /path/to/your/src/ --namespaces --packaging
After running, review changes with git diff and commit.
Documentation
Full documentation: https://bluedynamics.github.io/plone-codemod/
Development
git clone https://github.com/bluedynamics/plone-codemod.git
cd plone-codemod
uv venv && uv pip install -e ".[dev]"
uv run pytest tests/ -v
Source Code and Contributions
The source code is managed in a Git repository, with its main branches hosted on GitHub. Issues can be reported there too.
We'd be happy to see many forks and pull requests to make this tool even better. We welcome AI-assisted contributions, but expect every contributor to fully understand and be able to explain the code they submit. Please don't send bulk auto-generated pull requests.
Maintainers are Jens Klein, Johannes Raggam and the BlueDynamics Alliance developer team. We appreciate any contribution and if a release on PyPI is needed, please just contact one of us. We also offer commercial support if any training, coaching, integration or adaptations are needed.
License
GPL-2.0 -- same as Plone.
Release files for plone-codemod 1.0.0a6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| plone_codemod-1.0.0a6.tar.gz | 61.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| plone_codemod-1.0.0a6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.5 kB
Release files / plone_codemod-1.0.0a6.tar.gz
| Download URL | plone_codemod-1.0.0a6.tar.gz |
|---|---|
| Size | 61.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ee18e64291b024ec83b6b5128e04c6e7c31e1719277252d4cbb79514bdef26e
|
|
BLAKE2b-256 checksum How to use checksums |
5d30c6476c231cc6ad389bc4538218193358a0da2f7025be4eec8bc949971762
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency logRelease files / plone_codemod-1.0.0a6-py3-none-any.whl
| Download URL | plone_codemod-1.0.0a6-py3-none-any.whl |
|---|---|
| Size | 35.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec09bd66ba5422dd55bf83c3fe02e14df61ce5c877865bff83976b71cb2604e5
|
|
BLAKE2b-256 checksum How to use checksums |
e28f82c6e3c28d4aa2623448df645e53451edf54e6b27de9b5ee976edaf5b5bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.
Transparency log