refac
A tool for moving and refactoring python code. It supports moving files or entire directories (refac file). Also supports moving specific symbols inside a file (refac symbol) or specific imports (refac import).
Quickstart
pip install refac
refac file /path/to/src.py /path/to/dst.py
and add the following to your .libcst.codemod.yaml at the root of your project:
modules:
- "refac.visitors"
usage:
refac [file|symbol|import] <src> <dst>
examples:
refac file /path/to/src.py /path/to/dst.py
refac symbol path.to.SrcClass path.to.DstClass
refac symbol path.to.src_func1,path.to.src_func2 path.to.dst_func1,path.to.dst_func2
refac import path.to.src_import path.to.dst_import
Contributing
Contributions are welcomed and appreciated. Check out ARCHITECTURE.md for an overview of the codebase.
To run tests:
# Must be using Python >3.9
python -m pip install -r requirements.txt
python -m unittest tests/**/*.py
Please file GitHub issues for any bugs.
Metadata
Release files for refac 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| refac-0.0.5.tar.gz | 16.2 kB | Without provenance | Details for refac-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| refac-0.0.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for refac-0.0.5-py2.py3-none-any.whl |
Total release size: 36.2 kB
Release files / refac-0.0.5.tar.gz
| Download URL | refac-0.0.5.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68b8a7d2c4b676ea02c9770ca704a6a2c94ad488b1e06960295644c56e8ab80e
|
|
BLAKE2b-256 checksum How to use checksums |
c651f4d2179e7eba23f33ff95dbd55bb3ceb1946a97859f359ec5aaf032c5ef3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / refac-0.0.5-py2.py3-none-any.whl
| Download URL | refac-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e45d4bd51c0ec2797b99e7625732b24112df862903bb135b76f1c5486175503e
|
|
BLAKE2b-256 checksum How to use checksums |
4d26cc0999c879af1fe6f3b7734a37ecffd8e8755a9f5a57bd8172fbe0e5570a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Security for refac 0.0.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.