Observed since 21 Oct, 11:24 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A minimal library for smart Python imports with automatic path resolution
A minimal library for python: Adding support for smart imports with automatic path resolution.
import aimport
This automatically adds relevant directories to sys.path based on __aimport__ anchor files found in the directory tree.
__aimport__ anchor files__aimport__ files can contain paths that will be used instead of the file location__aimport__ files can contain multiple paths, one per line__init__.py files when no __aimport__ files are foundsys.path instead of appended, giving them higher import prioritysys.path⚠️ Import Priority Change: Starting with v2.0.0, discovered paths are prepended to sys.path instead of appended. This means modules in aimport-discovered directories will take precedence over existing sys.path entries. This change ensures that project-local modules are found before system or virtual environment modules.
🎉 Multiple Paths Support: __aimport__ files can now contain multiple paths, one per line. This allows a single anchor file to reference multiple directories that should be added to the import path.
__aimport__ files__aimport__ file contains valid paths (one per line), those paths are used; otherwise the file's directory is used__aimport__ file is treated as a separate path - empty lines and whitespace-only lines are ignored__aimport__ files are found, falls back to searching for __init__.py filessys.path for higher import priority__aimport__ files can contain:
Example __aimport__ file with multiple paths:
../lib
./vendor
/absolute/path/to/modules
The project includes comprehensive unit tests using pytest:
# Install development dependencies
uv sync --dev
# Run all tests
./test.sh
# Or run pytest directly
uv run pytest tests/ -v
# Build distribution
python setup.py sdist
# Upload to PyPI
twine upload dist/*
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 2.1.0 | 14 Aug 2025 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 11:24 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7b73a4321f76cd7fd408666e0be17819f159e15fbba78a79213deac58295d013