Skip to main content

A really simple library for interactive python CLIs.

Project description

PyCLI

PyCLI is a really simple library for interactive python CLIs. I mostly built it for personal use on side projects, but feel free to use it.

Install Instructions

To install:

pip install simplepycli

Basic API Example

The API is really simple, so here is a comprehensive example of how it works. This is also available at example.py:

from simplepycli import PyCLIApp

# The only paramater for PyCLIApp is the marker to use in front of the terminal; defaults to "> "
app = PyCLIApp("> ")

@app.command("egg", "Prints egg to the console")
def egg(params):
  print("egg")

@app.command("echotwice", "Echos the string passed in as a paramater twice")
def echotwice(params):
  for i in range(2):
    print(params)

app.run()

This outputs a terminal that behaves like this

> egg
egg
> echotwice abc
abc
abc
> help
exit : Exit the current CLI session and close the program.
help : List available commands and their help messages.
clear : Clear the current command line.
egg : Prints egg to the console
echotwice : Echos the string passed in as a paramater twice
> |

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

simplepycli-1.0.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

simplepycli-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file simplepycli-1.0.0.tar.gz.

File metadata

  • Download URL: simplepycli-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.0 CPython/3.8.10 Linux/5.15.0-58-generic

File hashes

Hashes for simplepycli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 89a1e5d9b8bd723b747e529c46619dfa848f4f8533696d00f4bf826f89e9d47c
MD5 b376b663196d7b0dac85b8238a5849fd
BLAKE2b-256 eebd4410d59ef99a9dc113f7689ba52f13995e593262d8d6db4feab8f738cbe0

See more details on using hashes here.

File details

Details for the file simplepycli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: simplepycli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.0 CPython/3.8.10 Linux/5.15.0-58-generic

File hashes

Hashes for simplepycli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da929027cb5512232e6ec3db8a73998fc743b0fa0f4e94dae8293fc44b87143c
MD5 21369b0289490f939011e1ec634d4afb
BLAKE2b-256 437b34bb6245b9f083e0a0d28f1174ee03c8aff5f312439cf37bb0d3f4b9df2f

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