About
A Cuty-Series Custom Python Formatter
Installation
pip install cutykt
Usage
Format a file or directory:
cutykt path/to/file_or_directory
Check if files need formatting (useful for CI or pre-commit):
cutykt --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, CutyKt 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
cutykt
├── __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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cutykt-0.1.0.tar.gz.
File metadata
- Download URL: cutykt-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f234569be40eaefb87ee8e99b0eaaede5686c490bc2d1c0e4c9bca06ae12dbb
|
|
| MD5 |
cc2ca1fc16d5bf61d7fa5e52f74e640d
|
|
| BLAKE2b-256 |
e393ac907496481330364f73e1122572f3448a432efe23314975dac661be5b17
|
File details
Details for the file cutykt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cutykt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c65109991c606126d04a4f79e49594eaba27fa1159785520827fa614aa9987eb
|
|
| MD5 |
8029836752a16555c9e676dfd41c0326
|
|
| BLAKE2b-256 |
eb26fbae1109d383d4f56021507743d4293a69fdc15e655b991142b23c005cda
|