Metadata-Version: 2.1
Name: refac
Version: 0.0.1
Summary: Tool to move around Python source code.
Home-page: https://github.com/benchling/refac
Author: Benchling Eng
Author-email: eng@benchling.com
Maintainer: Benchling Eng
Maintainer-email: eng@benchling.com
License: MIT License
Keywords: refactor,symbol,move
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE

# 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).

[![Checks](https://github.com/benchling/refac/actions/workflows/checks.yaml/badge.svg?branch=main&event=push)](https://github.com/benchling/refac/actions/workflows/checks.yaml)

## Quickstart

```bash
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:

```yaml
modules:
  - "refac.visitors"
```

```bash
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:

```bash
# 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.
