
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
This is the Python version of the Codemodder Framework.
Codemodder is sponsored by pixee.ai.
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.
The codemodder
package is available on PyPI. To install, run:
$ pip install codemodder
WARNING: You should also install the semgrep optional dependency for now as it isn't deprecated yet:
$ pip install codemodder[semgrep]
To install the package from source, use pip
:
$ pip install /path/to/codemodder-python
codemodder
Codemodder can be run as a CLI. 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
You can also run codemodder
as a library by importing the module and running run
. For basic usage, pass a target directory path and the dry_run
argument:
import codemodder
output, exit_code = codemodder.run("/path/to/my-project", dry_run=True)
Unlike the CLI which has a default dry_run
of False
, when calling codemodder
as a library you must indicate if you want codemodder
to make changes to your files.
Codemods are composed of the following key components:
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.
Coming soon!
See CONTRIBUTING.md.
FAQs
A pluggable framework for building codemods in Python
We found that codemodder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.