Pyramid provides the pyramid.paster.bootstrap()
to make it easy to create a script with your application. Turning a script into a command isn't done through any complicated construct provided by Pyramid, but rather you should just use setuptools entry points. This involves adding a [console_scripts]
section to your setup.py
entry_points
, re-running develop, and your script should be installed into the bin
directory.
setup(
# ...
entry_points={
'paste.app_factory': [
'main = myapp:main',
],
'console_scripts': [
'myscript = myapp.scripts.myscript:main',
],
)