Catalog PyPI
PACKAGE EXPLORERView in registry

aesthetic-imports

PyPI

A Python utility to sort imports beautifully by length and geometric shapes.

Versions collected1
Direct dependencies1From release 0.1.1
Last observed20 Oct, 20:52 UTC

README

Version 0.1.1 documentation

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

Downloads & popularity

1downloads
1-day window · source-reported counts20 Oct 2026
90450
2026-09-06: 90 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-06–2026-09-062026-09-07: 14 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-07–2026-09-072026-09-08: 4 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-08–2026-09-082026-09-09: 5 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-10–2026-09-102026-09-11: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-11–2026-09-112026-09-12: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-12–2026-09-122026-09-14: 6 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-14–2026-09-142026-09-16: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-16–2026-09-162026-09-17: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-17–2026-09-172026-09-18: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-18–2026-09-182026-09-19: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-19–2026-09-192026-09-20: 3 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-20–2026-09-202026-09-21: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-21–2026-09-212026-09-22: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-22–2026-09-222026-09-23: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-23–2026-09-232026-09-24: 3 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-24–2026-09-242026-09-26: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-27–2026-09-272026-09-28: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-28–2026-09-282026-09-29: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-29–2026-09-292026-09-30: 6 · observed 2026-10-21T10:42:02.9606451Z · period 2026-09-30–2026-09-302026-10-01: 2 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-01–2026-10-012026-10-02: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-02–2026-10-022026-10-05: 3 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-05–2026-10-052026-10-06: 4 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-06–2026-10-062026-10-08: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-08–2026-10-082026-10-09: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-09–2026-10-092026-10-10: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-10–2026-10-102026-10-13: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-13–2026-10-132026-10-15: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-15–2026-10-152026-10-16: 3 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-16–2026-10-162026-10-17: 5 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-17–2026-10-172026-10-20: 1 · observed 2026-10-21T10:42:02.9606451Z · period 2026-10-20–2026-10-20
6 Sept20 Oct

pypistats · 34 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2012026-10-21T10:42:02.9606451Z
2026-10-17 – 2026-10-1752026-10-21T10:42:02.9606451Z
2026-10-16 – 2026-10-1632026-10-21T10:42:02.9606451Z
2026-10-15 – 2026-10-1512026-10-21T10:42:02.9606451Z
2026-10-13 – 2026-10-1312026-10-21T10:42:02.9606451Z
2026-10-10 – 2026-10-1012026-10-21T10:42:02.9606451Z
2026-10-09 – 2026-10-0912026-10-21T10:42:02.9606451Z
2026-10-08 – 2026-10-0812026-10-21T10:42:02.9606451Z
2026-10-06 – 2026-10-0642026-10-21T10:42:02.9606451Z
2026-10-05 – 2026-10-0532026-10-21T10:42:02.9606451Z
2026-10-02 – 2026-10-0212026-10-21T10:42:02.9606451Z
2026-10-01 – 2026-10-0122026-10-21T10:42:02.9606451Z
2026-09-30 – 2026-09-3062026-10-21T10:42:02.9606451Z
2026-09-29 – 2026-09-2922026-10-21T10:42:02.9606451Z
2026-09-28 – 2026-09-2812026-10-21T10:42:02.9606451Z
2026-09-27 – 2026-09-2712026-10-21T10:42:02.9606451Z
2026-09-26 – 2026-09-2612026-10-21T10:42:02.9606451Z
2026-09-24 – 2026-09-2432026-10-21T10:42:02.9606451Z
2026-09-23 – 2026-09-2312026-10-21T10:42:02.9606451Z
2026-09-22 – 2026-09-2222026-10-21T10:42:02.9606451Z
2026-09-21 – 2026-09-2112026-10-21T10:42:02.9606451Z
2026-09-20 – 2026-09-2032026-10-21T10:42:02.9606451Z
2026-09-19 – 2026-09-1922026-10-21T10:42:02.9606451Z
2026-09-18 – 2026-09-1822026-10-21T10:42:02.9606451Z
2026-09-17 – 2026-09-1712026-10-21T10:42:02.9606451Z
2026-09-16 – 2026-09-1622026-10-21T10:42:02.9606451Z
2026-09-14 – 2026-09-1462026-10-21T10:42:02.9606451Z
2026-09-12 – 2026-09-1222026-10-21T10:42:02.9606451Z
2026-09-11 – 2026-09-1112026-10-21T10:42:02.9606451Z
2026-09-10 – 2026-09-1012026-10-21T10:42:02.9606451Z
2026-09-09 – 2026-09-0952026-10-21T10:42:02.9606451Z
2026-09-08 – 2026-09-0842026-10-21T10:42:02.9606451Z
2026-09-07 – 2026-09-07142026-10-21T10:42:02.9606451Z
2026-09-06 – 2026-09-06902026-10-21T10:42:02.9606451Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.16 Sept 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:52 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2854757172c4fd913e381b5512b3a4faa98632fdd591ab2e5e97d6617b06b506