Skip to main content

A minimal library for smart Python imports with automatic path resolution

Project description

aimport

A minimal library for python: Adding support for smart imports

Usage

import aimport

This automatically adds relevant directories to sys.path based on __aimport__ anchor files found in the directory tree.

Features

  • Smart path resolution: Automatically discovers project roots using __aimport__ files
  • Fallback support: Falls back to __init__.py files when no __aimport__ files are found
  • Duplicate prevention: Avoids adding duplicate paths to sys.path
  • Automatic execution: Works immediately upon import

Testing

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

Test Coverage

  • 23 comprehensive test cases
  • Full coverage of all functions and edge cases
  • Integration tests for complex directory structures
  • Behavior-focused testing (not implementation details)

Development

# Build distribution
python setup.py sdist

# Upload to PyPI
twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aimport-1.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aimport-1.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file aimport-1.1.0.tar.gz.

File metadata

  • Download URL: aimport-1.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aimport-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d2cd186b429975c17fc77000e5c390fc70848b5979b85420b799b45571a43ca0
MD5 85840523b00668d0af7f7ec816afded7
BLAKE2b-256 89430b0079706d9c1c6caec7e32f56326968dfe3f90e9bc01c3483a4c940e784

See more details on using hashes here.

File details

Details for the file aimport-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: aimport-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aimport-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cfb1a18d510cb4d2861b6b199a9e1f7afce6127cbc4180a8abd6c498804a109
MD5 3d198ce6c0d38d4c4ca8a22747ce2a7e
BLAKE2b-256 6386c3368709dd3d23d921fe2941436561dca0456fd8d530abf3a7e0c8047958

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page