I’ve read the documentation on egg entry points in Pylons and on the Peak pages, and I still don’t really understand. Could someone explain them to me?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An "entry point" is typically a function (or other callable function-like object) that a developer or user of your Python package might want to use, though a non-callable object can be supplied as an entry point as well (as correctly pointed out in the comments!).
The most popular kind of entry point is the
console_scriptsentry point, which points to a function that you want made available as a command-line tool to whoever installs your package. This goes into yoursetup.pyscript like:I have a package I’ve just deployed called
cursive.tools, and I wanted it to make available a "cursive" command that someone could run from the command line, like:The way to do this is define a function, like maybe a
cursive_commandfunction in the filecursive/tools/cmd.pythat looks like:and so forth; it should assume that it’s been called from the command line, parse the arguments that the user has provided, and … well, do whatever the command is designed to do.
Install the
docutilspackage for a great example of entry-point use: it will install something like a half-dozen useful commands for converting Python documentation to other formats.