Metadata-Version: 2.4
Name: aesthetic-imports
Version: 0.1.1
Summary: A Python utility to sort imports beautifully by length and geometric shapes.
Author: npavlovic
Project-URL: Homepage, https://codeberg.org/npavlovic/aesthetic-imports
Project-URL: Repository, https://codeberg.org/npavlovic/aesthetic-imports
Project-URL: Issue Tracker, https://codeberg.org/npavlovic/aesthetic-imports/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: libcst>=1.0.0

# Aesthetic Imports

`aesthetic-imports` is a command-line tool that reorganizes import lines at the top of your Python files into geometric shapes based on line length.

Instead of standard alphabetical sorting, it formats imports into triangles, cones and hourglasses — powered by `libcst`.

## Installation

pip install aesthetic-imports

## Usage

Run `aesthetic-imports` followed by the paths to your Python files:

aesthetic-imports main.py

### Options & Shapes

* **-s, --shape**: Choose the visual layout for your imports.
  * `asc` / `L` (default): Ascending line length (short to long)
  * `desc` / `J`: Descending line length (long to short)
  * `conical` / `>`: Wide in the middle, narrow at top/bottom
  * `hourglass` / `<`: Wide at top/bottom, narrow in the middle
* **--dry-run**: Preview changes in terminal boxes without modifying files.
* **-v, --verbose**: Enable debug output.
* **--ask-before-edit**: Prompt for confirmation before applying changes.

### Examples

Preview changes in conical shape without writing to files:
aesthetic-imports --shape asc --dry-run script.py

## Visual Examples

### Ascending / L-Shape (`-s asc` or `-s L`)

Sorts imports cleanly from shortest line length to longest.

**Before:**
```python
from my_custom_package.utils.helpers import long_function_name
import os
from typing import List, Optional, Dict, Any
import sys
import libcst as cst
from datetime import datetime
```

**After:**
```python
import os
import sys
import libcst as cst
from datetime import datetime
from typing import List, Optional, Dict, Any
from my_custom_package.utils.helpers import long_function_name
```
