About
A Cuty-Series Custom Python Formatter
Installation
pip install cutypy
Usage
Format a file or directory:
cutypy path/to/file_or_directory
Check if files need formatting (useful for CI or pre-commit):
cutypy --check path/to/project
If formatting changes are required in check mode, formatter exits with a non-zero status code.
About
The tool is a minimal and fast Python formatter designed to enforce consistent formatting rules across Python codebases.
Unlike large formatters that heavily restructure code, CutyPy focuses on deterministic formatting rules applied through a small rule engine. Each rule handles a specific formatting concern such as indentation, spacing, blank lines, or import ordering.
The formatter processes files using modular formatting rules, making the system easier to reason about, extend, and control.
Features
- Deterministic Python formatting
- Rule-based formatting system
- Import sorting
- Consistent indentation enforcement
- Blank line normalization
- Trailing space cleanup
- Line ending normalization
- Automatic EOF newline insertion
- Optional check mode for CI pipelines
Project Structure
cutypy
├── __init__.py
├── __main__.py
├── checker
│ ├── __init__.py
│ └── check_line_length.py
├── cli
│ ├── __init__.py
│ ├── args_handler.py
│ └── version.py
├── common
│ ├── __init__.py
│ ├── compact.py
│ ├── expand.py
│ └── reset.py
├── core
│ ├── __init__.py
│ └── main.py
├── engine
│ ├── __init__.py
│ ├── discovery.py
│ ├── pipelines
│ │ ├── __init__.py
│ │ ├── check.py
│ │ └── solve.py
│ └── worker.py
├── models
│ ├── __init__.py
│ ├── args.py
│ └── content.py
└── solver
├── __init__.py
├── add_eof_double_blanks.py
├── add_keyword_blanks.py
├── fix_double_blanks.py
├── fix_import_order.py
├── fix_indentation.py
├── fix_line_ends.py
└── remove_blanks.py
Design Philosophy
The formatter is built around a few core ideas:
- Minimal implementation
- Explicit formatting rules
- Predictable output
- Easy extensibility
- Suitable for automation (CI / pre-commit)
Rather than trying to cover every stylistic decision, the formatter focuses on enforcing a small set of reliable formatting guarantees.
Links
Made with <3 by AttAditya
Release files for cutypy 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cutypy-0.3.4.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cutypy-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.2 kB
Release files / cutypy-0.3.4.tar.gz
| Download URL | cutypy-0.3.4.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
231536d4590e4c0962c1534f6aa7c68502f9317fb05109f950f36ece3ae646bd
|
|
BLAKE2b-256 checksum How to use checksums |
f7e60dd23c1639651c82bdbc800b7780d64875ecf5bfaee64de5401e072cbb2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / cutypy-0.3.4-py3-none-any.whl
| Download URL | cutypy-0.3.4-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
814095c6372133907a00ccf74c1a2c203496e81d5be7aa509caa713ed1c535c6
|
|
BLAKE2b-256 checksum How to use checksums |
91f846c912abd63e193f45cfc704f67df809bc1d2e1828eb0b357f89c6abc1e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|