--- id: entrypoint version: "2.1.0" license: MIT license_treatment: permissive maintenance: dormant --- # entrypoint — Decorated functions as entry points. License: permissive · Maintenance: dormant · Downloads: 110.4K/mo ## What it is and what it does entrypoint is a lightweight decorator library that simplifies defining console entry points in Python scripts. Instead of writing the standard `if __name__ == "__main__":` boilerplate, you decorate your main function with `@entrypoint(__name__)` and it executes only when the script runs directly, not when imported. The library depends on attrs, named, and typing-aliases for its implementation. The package offers multiple usage patterns: a simple decorator form for immediate execution, a `.call()` method for manual control over when the function runs, and an `is_main()` function that mimics the traditional `if __name__ == "__main__":` check. It enforces the convention that entry point functions take no arguments and return nothing, though this is only validated by type-checkers, not at runtime. Use it for: - Simplify CLI script definitions by replacing repetitive `if __name__ == "__main__":` blocks with a clean decorator. - Ensure main functions are never accidentally executed during module imports in larger projects. - Build command-line tools where you want explicit, type-safe entry point declarations. - Migrate existing scripts to a more declarative entry point style without changing logic. - Enforce consistent entry point patterns across a team or codebase. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a decorator to mark functions as entry points, eliminating boilerplate code for console script execution while preventing accidental execution on import. Yes, if you write console scripts regularly and want cleaner, more explicit entry point declarations. The package is stable, has no security issues, and adds minimal dependency weight. The dormant maintenance is not a concern—it is feature-complete and unlikely to need updates. Install it for codebases where you value readability and consistency in script structure. ## Install pip install entrypoint uv add entrypoint poetry add entrypoint ## Installing entrypoint Before you install: Low friction installation with a pure Python wheel. Maintenance is dormant—last release was 789 days ago—but the package is marked Production/Stable and has no known vulnerabilities, suggesting it is feature-complete rather than abandoned. License in practice: MIT license is permissive and imposes no restrictions on commercial or private use, modification, or redistribution, making this safe for any project. Quickstart: from entrypoint import entrypoint @entrypoint(__name__) def main() -> None: print("Hello, world!") # Run: python file.py → prints "Hello, world!" # Import: import file → no output Requires Python 3.8 or above. Verify before relying: - Whether the package is actively maintained or considered feature-complete and stable by design. - Real-world adoption rate beyond the top 15000 PyPI packages metric. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 110.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags entry point decorator, console script boilerplate, main function decorator, decorated entry points, script entry point helper, avoid if __name__ == __main__, entry point abstraction, cli-scripting, decorator-pattern [View on SkillFed](https://skillfed.io/packages/entrypoint) · [View on PyPI](https://pypi.org/project/entrypoint/)