Skip to main content

A pluggable framework for building codemods in Python

Project description

Pixee Logo

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
Base Codemod Diagram

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

codemodder-0.91.0.tar.gz (645.4 kB view details)

Uploaded Source

Built Distribution

codemodder-0.91.0-py3-none-any.whl (245.3 kB view details)

Uploaded Python 3

File details

Details for the file codemodder-0.91.0.tar.gz.

File metadata

  • Download URL: codemodder-0.91.0.tar.gz
  • Upload date:
  • Size: 645.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for codemodder-0.91.0.tar.gz
Algorithm Hash digest
SHA256 090b522d1c860aad08fd7c7e9f4234c737669b2190d4cd9e9318885b2e8d74d9
MD5 f9ce7f1ec466355602a6d07dc90a6a96
BLAKE2b-256 031e1bf276527d96ae0d983ebfaf06b0cd147f37ea47c4fdc3aece59c1a42b18

See more details on using hashes here.

File details

Details for the file codemodder-0.91.0-py3-none-any.whl.

File metadata

  • Download URL: codemodder-0.91.0-py3-none-any.whl
  • Upload date:
  • Size: 245.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for codemodder-0.91.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db98b787851b37cf71d019876902531a74e087e5ea5388f15734c264e77e2a45
MD5 57b06d3d4b6e7a5b0890b5dc5dc78c05
BLAKE2b-256 05d8d8aee64c19f0b02f6a12a41b91371921dd14359c1fef883c7b6bb16f2be2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page