Skip to main content

About

A Cuty-Series Custom Python Formatter

Installation

pip install cutycode

Usage

Format a file or directory:

cutycode path/to/file_or_directory

Check if files need formatting (useful for CI or pre-commit):

cutycode --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, CutyCode 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

cutycode
├── __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 cutycode 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cutycode 1.0.3
File Size Uploaded
cutycode-1.0.3.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cutycode 1.0.3
File Interpreter ABI Platform
cutycode-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / cutycode-1.0.3.tar.gz

Download URL cutycode-1.0.3.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0d3494a6031390cd1fd2d5d87fe0337afd4464b8dd7c0f2fd406068246d2ac8f
BLAKE2b-256 checksum
How to use checksums
5ba7f281dd7ec92b2eadf25a620b2b73b31191ed93eccd2b24c696aabc867da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / cutycode-1.0.3-py3-none-any.whl

Download URL cutycode-1.0.3-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef3b430c0b8636c3cc1e4f1c0ed52b201f301c634ebfe0460a04fb54c1f00c82
BLAKE2b-256 checksum
How to use checksums
82f3b8cda75ea694a2066102799acf48ad57223359e22db44c1b599cd0a603e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page