entry point
A declared command name that, when your package is installed, becomes a real command which calls a chosen function.
In more detail
In pyproject.toml, [project.scripts] wordcount = "wordcount.cli:main" makes pip create a wordcount command that calls main in wordcount/cli.py, on every operating system. The command is placed in the environment's bin or Scripts folder, so it runs from any directory while that environment is on PATH.
Example
[project.scripts]
wordcount = "wordcount.cli:main"Related terms
- pyproject.toml — The standard configuration file at the root of a Python project, describing its name, version, dependencies, commands and build system.
- editable install — Installing your own project with pip install -e, followed by the project folder, so the environment runs your source files directly and edits take effect without reinstalling.
- script — A program, usually short, that is run directly to do a job, as opposed to a module written to be imported.
Taught in
- Shipping: scripts, entry points and git — Hands-on Python: Complete Video Course & Book