A pluggable framework for building codemods in Python
Project description
codemodder-python
This is the Python version of the Codemodder Framework.
Codemodder is sponsored by pixee.ai.
Development Status
As of v0.80.0 the codemod API is relatively stable. However, backwards compatibility between releases will not be guaranteed until version 1.0.0.
See CHANGELOG.md for detailed release notes.
Installation
The codemodder
package is available on PyPI. To install, run:
$ pip install codemodder
To install the package from source, use pip
:
$ pip install /path/to/codemodder-python
Running Locally
The codemodder package provides an executable called codemodder
. This should be available on your path by default after installation.
For basic usage, run the codemodder
command with a target directory path:
$ codemodder /path/to/my-project
Note that by default codemodder
will make changes to files in your target directory. To run codemodder
without making updates on disk, use the --dry-run
flag:
$ codemodder --dry-run /path/to/my-project
To list all available codemods (including any that are registered with installed plugins), use the --list
option:
$ codemodder --list
For a full list of options, use the --help
flag:
$ codemodder --help
Architecture
Codemods are composed of the following key components:
- Detector
- Transformer(s)
- Metadata
Custom Codemods
The Python codemodder supports a plugin infrastructure for custom codemods. For users interested in developing a custom codemod plugin, we recommend starting with the Cookiecutter template.
Documentation
Coming soon!
Contributing
See CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file codemodder-2.4.0.tar.gz
.
File metadata
- Download URL: codemodder-2.4.0.tar.gz
- Upload date:
- Size: 698.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc7e7916d7a2c61967808d4273ef83c3cc7d4b75fb0c1b873be22edf4ba63ff0 |
|
MD5 | 9fa0a9871602b25ae813d1f51afa0563 |
|
BLAKE2b-256 | 3324d577e6eeea37d7f7c445f3a9d83fecd91ef06a8fed4931a3b3cf662d2122 |
File details
Details for the file codemodder-2.4.0-py3-none-any.whl
.
File metadata
- Download URL: codemodder-2.4.0-py3-none-any.whl
- Upload date:
- Size: 284.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4516dc3fa3b543d1f1d3ae1f3cf0a62bf4695b43af3598b14f15857acd906490 |
|
MD5 | 61e8c5d85b952c303262a37f2639d40d |
|
BLAKE2b-256 | f80702621c226d5ad84b218c3c13a22449f438558c43620e3ee445b4e966be19 |