Entrypoint2 is an easy-to-use command-line interface for Python modules. It translates function signatures and documentation directly into `argparse` configurations, simplifying CLI creation. The current version is 1.1. Releases appear to be infrequent and event-driven, rather than on a fixed cadence.
pip install entrypoint2Verified import paths — ran on the pinned version, not inferred.
Define a function and decorate it with `@entrypoint`. The function's arguments become command-line parameters. You can then run the module as a script.
Ensure you are using `entrypoint2` version 1.1 or higher for Python 3 projects. Migrate Python 2 code if necessary.
Always provide a default value with the desired type (e.g., `def func(count=0):`) or explicitly cast the argument within your function if a default is not suitable.
Avoid starting multiple parameters with the same letter if you rely on automatic short flag generation, or explicitly define short flags using `entrypoint`'s advanced options (if available, consult documentation) if unique short flags are critical.
To ensure correct version reporting, define only one of `__version__`, `VERSION`, or `version` in your module, or explicitly pass the version string to the decorator if such an option is provided (consult official documentation).
When running the script, provide the missing argument. For example, if 'message' is required, run `python your_script.py 'hello world'`.
Install `entrypoint2` using pip: `pip install entrypoint2`. Ensure your virtual environment is activated if applicable.
First, ensure `pip` and `setuptools` are up-to-date: `pip install --upgrade pip setuptools`. Then, reinstall your package, preferably in a clean virtual environment, or use `pip install -e .` for editable installs during development.
No dependency data recorded yet.