emport
Utility library for performing programmatic imports
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
BSD 3-Clause License (permissive) — 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.
last release 2024-10-13 (670 days) · last repo commit 2025-10-07 · 6 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 92,662 downloads/mo, #13,436 on PyPI
Alternatives
Verify before relying
pip install emport
from emport import import_file
my_module = import_file('/path/to/file.py')- 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.).
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 on this page. Verify before relying on it.
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
emport on PyPI
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 the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagelogbook |
| Maintenance | Aging 670 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 92,662 / month, #13,436 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: emport-1.4.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “import python file by filename”
- emportEmport provides a single function to import Python files by filename,…
- sanitize-filenameRemoves or replaces problematic characters from filenames while…
- pathvalidateSanitize and validate filenames and file paths by removing or…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also locate · pyinvoke · absolufy-imports · ipynb · rootpath · mo-imports · import-deps · tendo · lazy-import · bazel-runfiles