A minimal and ridiculously good looking command-line-interface toolkit
Project description
It looks good and delegates all the real work to you ;)
A minimal and ridiculously good looking command-line-interface toolkit.
In four points:
- Completely customizable help page, but pretty by default.
- Add new commands at any time and from other files.
- No sub-commands but grouping of commands instead.
- Easy to use and understand.
An example
This autogenerated (and completely customizable) help message comes from running the example below:
# example.py
from pyceo import Manager, param, option
cli = Manager("Welcome to Proper v1.2.3")
@cli.command(help="Creates a new Proper application at `path`.")
@param("path", help="Where to create the new application.")
@option("quiet", help="Supress all output.")
def new(path):
"""The `proper new` command creates a new Proper application with a default
directory structure and configuration at the path you specify.
Example: `proper new ~/Code/blog`
This generates a skeletal Proper application at `~/Code/blog`.
"""
pass
@cli.command()
@option("num", type=int) # Optional type
def fizzbuzz(num=3):
"""A bad fizz buzz."""
print("fizz " * num + "buzz")
@cli.command(group="db")
@option("message", help="Revision message")
@option("sql", help="Dont emit SQL to database - dump to standard output instead")
@option("head", help="Specify head or <branchname>@head to base new revision on")
def migrate(**kwargs):
"""Autogenerate a new revision file.
This is an alias for "revision --autogenerate"."""
pass
@cli.command(group="db")
@option("name", help="Name of section in .ini file to use for Alembic config")
def branches(**kwargs):
"""Show current branch points.
"""
pass
if __name__ == "__main__":
# cli.run(default="new")
cli.run()
How minimal?
pyceo include a confirm()
and ask()
utilities, but not any features like progress bars, table formatting, file editing, etc. It doesn't matter because for those features many dedicated python libraries can be used.
You could say it focuses on its core competencies while synergetically interface with other libraries to take it to the next level. 💪🚀
Why don't just use optparse or argparse?
Are you kidding? Because this is way easier to use and understand.
Why don't just use click?
Because this looks better and is easier to use and understand.
Why don't just use...?
Because this library fits better my mental model. I hope it matches yours as well.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyceo-2.200716.tar.gz
.
File metadata
- Download URL: pyceo-2.200716.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.7.5 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c117f17d849748c179a4256e9417bd94e568552315351f57d5e95e7322f3dc |
|
MD5 | 02e8c912eddfe7c7f04f9de8465edb3d |
|
BLAKE2b-256 | 649a40ddd46985bd95a113f6e095f55c1995ed5b7053f9d2309f54e889e83558 |
File details
Details for the file pyceo-2.200716-py3-none-any.whl
.
File metadata
- Download URL: pyceo-2.200716-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0 CPython/3.7.5 Darwin/18.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3586b3053672a90897754b5c7d0f54eca81ae2093d7b34462d0a23c24a77de7a |
|
MD5 | e0fd7b63831f715f984a03941023b31d |
|
BLAKE2b-256 | 0994d1702361be41dee2e30bfb668642aad5c7fd55978a5b99de247376fa64e4 |