π importguard v0.1.0 - Initial Release
Measure and enforce import-time behavior in Python projects.
Features
- β±οΈ Import timing β Measure how long
import mypkgtakes using Python's-X importtime - π° Time budgets β Fail CI if imports exceed a threshold (
--max-ms 200) - π« Banned imports β Block heavy dependencies from your fast path (
--ban pandas) - π Reliable measurements β Run multiple times and report median (
--repeat 5) - π Config files β Define rules in
.importguard.toml - π Python API β Use
check_import()programmatically - π JSON output β Machine-readable results for CI integration
Installation
pip install importguardpy## Quick Start
Check import time
importguard check requests
Enforce a budget
importguard check mypkg --max-ms 200
Ban heavy imports
importguard check mypkg.cli --ban pandas --ban torch## Links
- π Documentation
- π Report Issues