Skip to main content

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

Project description

pyceo Tests Coverage Status

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

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()
@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 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.191031.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyceo-2.191031-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pyceo-2.191031.tar.gz.

File metadata

  • Download URL: pyceo-2.191031.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for pyceo-2.191031.tar.gz
Algorithm Hash digest
SHA256 6fe72ad05ded98b7ee93745e05b8e405cafe8384583b47f94dba80fad55aad99
MD5 ad5b20dcf28beff085865b60bc72f9a5
BLAKE2b-256 fab80e5951876a1aaa56c05997f3eb21ac3853546ebaeba7e9f65ace95004167

See more details on using hashes here.

File details

Details for the file pyceo-2.191031-py3-none-any.whl.

File metadata

  • Download URL: pyceo-2.191031-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for pyceo-2.191031-py3-none-any.whl
Algorithm Hash digest
SHA256 c2451b076bed41e19eb997f552b50a17be9e1ef5f2ffdaa5faad12cd7aacbb1c
MD5 dd8a9f5cc7a333433bf2ba93138b0a6e
BLAKE2b-256 69a154cbf327ee55af5a678058d3eb4a83a0f0e8729a6aeaa2899694b832f1b8

See more details on using hashes here.

Supported by

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