--- id: absolufy-imports version: "0.3.1" license: MIT license_treatment: permissive maintenance: abandoned --- # absolufy-imports — A tool to automatically replace relative imports with absolute ones. License: permissive · Maintenance: abandoned · Downloads: 317.0K/mo ## What it is and what it does absolufy-imports is a command-line tool and pre-commit hook that automatically rewrites relative imports as absolute imports. It operates on individual Python files and integrates into pre-commit workflows to enforce absolute import style across a codebase. The tool supports configuration for non-standard layouts via the `--application-directories` flag, which lets you specify where your package root lives. It also offers a `--never` flag to reverse the operation and convert absolute imports back to relative. With no runtime dependencies, it installs quickly and runs as a standalone utility or integrated into your version control hooks. Use it for: - Enforce absolute imports across a codebase as a pre-commit hook to maintain consistent import style. - Refactor code that uses relative imports to absolute imports for better IDE support. - Handle src-layout projects by specifying `--application-directories` to point to the correct root. - Batch-convert relative imports in legacy Python code during a modernization effort. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically converts relative imports to absolute imports in Python source files, with optional support for src-layout projects and pre-commit integration. Yes, if you need to standardize imports and are willing to accept that the project is no longer maintained. The tool is simple, has no dependencies, and works for its narrow purpose on Python 3.6–3.10. Use it as part of a pre-commit workflow or one-time refactoring task, but do not expect updates for future Python versions. ## Install pip install absolufy-imports uv add absolufy-imports poetry add absolufy-imports ## Installing absolufy-imports Before you install: Low install friction with no runtime dependencies. The project is archived and has not been updated since 2022-01-20, though it remains functional for Python 3.6 through 3.10. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: pip install absolufy-imports absolufy-imports myfile.py # Or in .pre-commit-config.yaml: # - repo: https://github.com/MarcoGorelli/absolufy-imports # rev: v0.3.0 # hooks: # - id: absolufy-imports Verify before relying: - Whether the tool correctly handles all edge cases in modern Python import syntax. - Compatibility with Python versions beyond 3.10 (classifiers list 3.10 as highest). - Whether the tool works reliably on modern Python versions given the project has been archived since 2022-01-20. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 317.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags convert relative imports to absolute, python import refactoring tool, absolute import converter, pre-commit import hook, relative to absolute imports, python code import formatter, import statement normalizer, import-refactoring, pre-commit-hook [View on SkillFed](https://skillfed.io/packages/absolufy-imports) · [View on PyPI](https://pypi.org/project/absolufy-imports/)