Skip to main content

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:

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:

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

Metadata

Release files for aesthetic-imports 0.1.1

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

Source distribution (sdist)

Source distribution for aesthetic-imports 0.1.1
File Size Uploaded Provenance
aesthetic_imports-0.1.1.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aesthetic-imports 0.1.1
File Interpreter ABI Platform
aesthetic_imports-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / aesthetic_imports-0.1.1.tar.gz

Download URL aesthetic_imports-0.1.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8313a5fdcbd07b86af2e210447382a57f2efed22ba33268db25288fc53ad8918
BLAKE2b-256 checksum
How to use checksums
7ce90a8d798ff6a17fc72e35248c7b69a2ef3b7650def116f94d8f79b220f8dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / aesthetic_imports-0.1.1-py3-none-any.whl

Download URL aesthetic_imports-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc7ecae71862437b659fde3d9fe1cdc0f0f3d80bcfa69031407e3a8f71b910d5
BLAKE2b-256 checksum
How to use checksums
1b4c0b7ff0c3774f8a9b9655766aca1db7976a5f5f5da345d87475272ec976fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for aesthetic-imports 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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