Simple tool for creating pluggable commands and sub-commands.
Usage example:
# in setup.py of your project specify argsrun entry point in console scripts
# and provided commands as follows:
setup(name="MyProj",
# ...
entry_points={
'console_scripts': [
'myproj = argsrun:main', # argsrun will handle main command
],
'myproj': [ # ...and lookup for this subcommands
'main = myproj:main',
'run = myproj.module:run',
],
})
In case you have several packages/projects and you want them to share same entry point, you can easily do it like follows:
# my-frontend-app/setup.py
setup(name="MySite Frontend",
entry_points={
'console_scripts': [
'mysite = argsrun:main',
],
'mysite': [
'serve-frontend = frontend:serve',
]
})
# my-backend-app/setup.py
setup(name="MySite Admin backend",
entry_points={
'console_scripts': [
'mysite = argsrun:main',
],
'mysite': [
'serve-admin = backend:serve',
]
})
# In my-frontend-app/frontend/__init__.py
import argsrun
def handler(options):
# Run frontend app
pass
def parser_setup(ap):
ap.add_argument('--port', help="Port to bind to")
main = argsrun.Entry(handler, parser_setup)
Metadata
Release files for argsrun 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| argsrun-0.0.2.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| argsrun-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / argsrun-0.0.2.tar.gz
| Download URL | argsrun-0.0.2.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d29a762860d4d3b73e6fe01f65a8f776f7fd00f5ec25374401b2cab584146d9
|
|
BLAKE2b-256 checksum How to use checksums |
a9a1e9d318c2ae024f76712b73498937df0efe9a91536a1e87d2f56439ce4d1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / argsrun-0.0.2-py3-none-any.whl
| Download URL | argsrun-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
844fbc8e5ccdeea0fc59e30beb8e22d2900d930315cb16b1a25de967c2fb3999
|
|
BLAKE2b-256 checksum How to use checksums |
96a9c3351069e25c8e0fc98dd0d94b872b76872c356fe3658d33a21e685d7954
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |