$npx skillfedfor your agent

aspy.refactor-imports

Utilities for refactoring imports in python-like syntax.

With conditionsPyPI Software DevelopmentReleased Jul 2022122.6K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — aspy.refactor_imports-3.0.2-py2.py3-none-any.whl
v3.0.2 · released 2022-07-01 · Python >=3.7 · 1 runtime deps: cached-property

Yes, if you are maintaining or extending existing code that already uses aspy.refactor_imports. No, if starting a new project—use the renamed version instead. The package is stable and has no known vulnerabilities, but it is in legacy maintenance mode with no active development beyond bug fixes.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low friction: pure Python wheel with a single runtime dependency (cached-property).
  • Maintenance is active with recent commits, though the latest release was in 2022; the package is stable but superseded by a newer version.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.

last release 2022-07-01 (1505 days) · last repo commit 2026-07-15 · 24 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 122,598 downloads/mo, #11,945 on PyPI

Verify before relying

pip install aspy.refactor_imports

from aspy.refactor_imports.import_obj import FromImport
obj = FromImport.from_str('from foo import bar')
print(obj.to_text())
  • Whether migration to the renamed version requires code changes
  • Performance characteristics when processing large import blocks or many files
Same gist for agents: .md · .json

What it is and what it does

aspy.refactor_imports provides utilities to parse and manipulate Python import statements as first-class objects. It lets you construct import objects from strings, split multi-import statements into individual ones, sort imports according to custom rules, and classify imports by type (FUTURE, BUILTIN, THIRD_PARTY, APPLICATION). The package is built on a single runtime dependency, cached-property, and supports Python 3.7 through 3.10 on CPython and PyPy.

The package is now maintained in legacy status: the author has rewritten and renamed it for version 4 and beyond. Existing code using aspy.refactor_imports will continue to work, but new projects should consider the renamed version instead. It remains useful for codebases already integrated with it or for tools that need fine-grained control over import parsing and sorting.

Use it for

  • Refactor import statements in a codebase to enforce consistent ordering and grouping conventions.
  • Build linting or formatting tools that need to parse and manipulate imports programmatically.
  • Classify imports by category (stdlib, third-party, local) to organize or validate import blocks.
  • Split comma-separated import statements into individual import lines for readability.
  • Sort imports according to custom rules (e.g., stdlib before third-party before application code).

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are maintaining or extending existing code that already uses aspy.refactor_imports.

No, if starting a new project—use the renamed version instead. The package is stable and has no known vulnerabilities, but it is in legacy maintenance mode with no active development beyond bug fixes.

Install

aspy-refactor-imports on PyPI

Before you install

Low friction: pure Python wheel with a single runtime dependency (cached-property). Maintenance is active with recent commits, though the latest release was in 2022; the package is stable but superseded by a newer version.

License in practice

MIT license permits commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install aspy.refactor_imports

from aspy.refactor_imports.import_obj import FromImport
obj = FromImport.from_str('from foo import bar')
print(obj.to_text())

Verify before relying

  • Whether migration to the renamed version requires code changes
  • Performance characteristics when processing large import blocks or many files

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
cached-property
MaintenanceActively maintained 1,505 days since the last release
Last repo commit
First released
Downloads122,598 / month, #11,945 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Evidence: aspy.refactor_imports-3.0.2-py2.py3-none-any.whl

Tags

Capabilities
python import parsingrefactor imports programmaticallyimport statement manipulationclassify python importsimport sorting and splittingimport object construction
Topics
import-toolingcode-refactoringlegacy

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “python import parsing”

  • aspy.refactor-importsParses, classifies, and manipulates Python import statements as…
  • tsv2pyParses and generates tab-separated values (TSV) data with high…
  • pyclnPycln finds and removes unused import statements from Python code,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also classify-imports · isort · reorder-python-imports · usort · import-deps · stdlib-list · flake8-tidy-imports · attributes-doc · ipynb · rope