--- id: emport version: "1.4.1" license: BSD 3-Clause License license_treatment: permissive maintenance: aging --- # emport — Utility library for performing programmatic imports License: permissive · Maintenance: aging · Downloads: 92.7K/mo ## What it is and what it does Emport is a small utility library that wraps Python's import machinery to load modules from arbitrary file paths. It exposes a single function, `import_file(filename)`, that handles the plumbing of converting a file path into an importable module object. The main value is that it abstracts away the complexity of edge cases: importing files that live inside packages (where relative imports matter), importing directories as packages by loading their `__init__.py`, and other scenarios where the standard `__import__`, `execfile`, or `imp.load_source` approaches either fail or require boilerplate. The package depends only on logbook for logging. It supports Python 3.8 through 3.13 and is distributed as a pure Python wheel, so installation is straightforward. The codebase is stable and aging—last updated in October 2025 with minimal recent activity—but carries no known security vulnerabilities and remains functional for its narrow, well-defined purpose. Use it for: - Load plugin or configuration modules from user-specified file paths without requiring them to be on sys.path. - Dynamically import test fixtures or helper modules stored outside the standard package structure. - Build tools or scripts that need to import Python files from arbitrary locations on disk. - Import modules that use relative imports from within packages, where standard import mechanisms would fail. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Emport provides a single function to import Python files by filename, handling edge cases like relative imports within packages and directory/`__init__.py` imports that standard import mechanisms don't easily support. Yes, if you need to import Python files by path and want to avoid the boilerplate of managing import hooks or manipulating sys.path. The low install friction, permissive license, and lack of vulnerabilities make it a safe choice. However, the aging maintenance status and minimal activity suggest it is not actively developed; if you encounter edge cases or need new features, expect to maintain a fork or use an alternative. ## Install pip install emport uv add emport poetry add emport ## Installing emport Before you install: Low friction: pure Python wheel, single lightweight dependency (logbook), and supports current Python versions (3.8–3.13). Last commit was recent (2025-10-07), though the package is aging overall with no active development signal. License in practice: BSD 3-Clause License is permissive; you may use, modify, and distribute this package freely in commercial and private projects, provided you retain the license notice. Quickstart: pip install emport from emport import import_file my_module = import_file('/path/to/file.py') Verify before relying: - Whether relative imports within imported files work correctly in all contexts (e.g., when the imported file references sibling modules). - Performance characteristics when importing large files or many files in sequence. - Compatibility with frozen/packaged applications (PyInstaller, etc.). ## Package facts - License: BSD 3-Clause License (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 92.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags import python file by filename, dynamic module loading, programmatic imports, load python file at runtime, import from path, relative import handling, import directory as module, dynamic-imports, module-loading [View on SkillFed](https://skillfed.io/packages/emport) · [View on PyPI](https://pypi.org/project/emport/)