classify-imports is a Python utility library designed for refactoring imports in Python-like syntax. It provides tools to parse import statements, classify them into categories (e.g., built-in, third-party, application), and sort them according to defined rules. The library is currently at version 4.2.0 and is actively maintained with a focus on import organization.
pip install classify-importsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the core functionalities of `classify-imports`: parsing a single import string into multiple, sorting a list of import objects into classified blocks, and determining the classification type of a module name. The `sort` function will arrange imports into 'FUTURE', 'BUILTIN', 'THIRD_PARTY', and 'APPLICATION' categories by default.
Update `pip install aspy.refactor-imports` to `pip install classify-imports` and change all import statements from `from aspy.refactor_imports import ...` to `from classify_imports import ...`.
Review the documentation for configuring application import paths and names if using in a larger project or with tools like `reorder-python-imports` that rely on its classification. Explicitly configure known application prefixes or modules if default heuristics are insufficient.
The package was renamed. Use `from classify_imports import ...` instead. If you haven't installed `classify-imports`, install it with `pip install classify-imports`.
Understand the default `Classified.order` ('FUTURE', 'BUILTIN', 'THIRD_PARTY', 'APPLICATION'). If a module is misclassified, ensure your environment or calling tool (like `reorder-python-imports`) correctly identifies application vs. third-party modules. Customization options might be available in tools integrating `classify-imports` to override the default order or classification logic.No dependency data recorded yet.