Skip to main content

A minimal and ridiculously good looking command-line-interface toolkit.

Project description

pyceo

It looks good and delegate all the 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

pyceo output

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()
def fizzbuzz():
    """The infamous fizz buzz."""
    pass


@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 doesn't include any related features like prompts, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyceo-2.0.9.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distributions

pyceo-2.0.9-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

pyceo-2.0.9-py2.py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page