Simplify script and package management by quickly creating a CLI that automatically parses arguments and returns of your functions. Get an instant understanding of your collection without diving into extensive documentation. Customize descriptions and add informative text, making script interaction easy without remembering all the details.
Install
pip install speed-cli
Basic Usage
from speed_cli import CLI
from your_package import test_func, test_func_two, test_func_three
CLI(menu=[
test_func,
test_func_two,
test_func_three
])
and that's it! With an example your_package.py file looking like this:
def test_func():
print("K")
def test_func_two(number):
print(f"Doing some calculations with: {number}!")
def test_func_three(my_num: int = 5, my_str: str = 'fredl') -> str:
return f"{my_num**2} {my_str}"
this would give you an interactive prompt like this:
.. of course, you can always modify your CLI and make it more fancy and descriptive! Lets say i want to give the second function some more description, and add custom fields:
from speed_cli import CLI, Color, MenuEntry
red = Color('red')
CLI(color="blue",
menu=[
test_func,
MenuEntry(func=test_func_two,
title="My second test function",
description="This function is used to do this and that!",
warning=f"Be aware to pass the argument {red.colorize('number')} !!"
),
test_func_three
])
would give you:
.. you can also add default arguments for your functions:
def test_func(some_str=None, some_int=None):
print(f"K {some_str} {some_int}")
CLI(menu=[
MenuEntry(func=test_func, args=["fredi", 10])
])
.. the Color class also allows you to simply use colored texts in your prints:
from speed_cli import Color
c = Color()
print(f"I like {c.colorize('colors')} to {c.colorize('emphasize', color='green', bold=True)} on the "
f"{c.colorize('important', color='black', background='bg_cyan')} stuff!")
gives you:
TODO:
- currently only accepts strings as arguments, conversions have to be done in underlying function; convert based on types if given
Metadata
Release files for speed-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| speed_cli-0.2.0.tar.gz | 6.6 kB | Without provenance | Details for speed_cli-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| speed_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for speed_cli-0.2.0-py3-none-any.whl |
Total release size: 13.1 kB
Release files / speed_cli-0.2.0.tar.gz
| Download URL | speed_cli-0.2.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46fd217c84b728dfa1f2663c51e1742677344fe06aa4a58b5a1dc3f534a1c7aa
|
|
BLAKE2b-256 checksum How to use checksums |
ddbe95e738635127f58ca8f895b34c7144e9a331abd76e60cd7994ca43e76390
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.2 Linux/6.9.3-surface-2
|
Release files / speed_cli-0.2.0-py3-none-any.whl
| Download URL | speed_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3aecb363a296c89ef25238f70fc1e5e934e53756f9f97bd21474a4c407c44a7e
|
|
BLAKE2b-256 checksum How to use checksums |
96a992946679f99cb18f86ff8646dfb92fda862dec893a40ce0c8c426c3b6158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.2 Linux/6.9.3-surface-2
|
Security for speed-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.