Framework for creating CLI tools
Project description
Ez cliy
A hassle-free framework for creating command line tools
Install
from PyPi
pip3 install ezcliy
or from directly from Github
pip3 install git+https://github.com/kpostekk/ezcliy.git
More details in docs
Fast example
from ezcliy import Command, Flag # Import required classes
class SmallTextProcessor(Command):
# Define excpected parameters
capitalize = Flag('-c', '--capitalize')
verbose = Flag('--verbose')
def invoke(self): # There put your sweet code
string = ' '.join(self.values)
if self.verbose:
print('Verbose stuff', self.parameters, self.values)
if self.capitalize:
string = string.capitalize()
if not string.endswith('.'):
string += '.'
print(string)
if __name__ == '__main__':
SmallTextProcessor().cli_entry()
The exec of that will look like this
./somescript.py "this sentence require cap" -c --verbose
And output will be
Verbose stuff {'capitalize': <Flag -c --capitalize has value True>, 'verbose': <Flag --verbose has value True>} ['this sentence require cap']
This sentence require cap.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
ezcliy-0.3.1-py3.9.egg
(7.3 kB
view details)
File details
Details for the file ezcliy-0.3.1-py3.9.egg
.
File metadata
- Download URL: ezcliy-0.3.1-py3.9.egg
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a49fbf4880e701d21a528cd9d18d5cd106e8dc15598dc73556fb3b172603107 |
|
MD5 | 6a2e69fad92cdc9b1cc0cd5c7754ce4f |
|
BLAKE2b-256 | 1acba6ca00c3f72fa085b9925f31eab706bc2b4cc2cb752e495563b49fd42984 |
File details
Details for the file ezcliy-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: ezcliy-0.3.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54954904777316d8bda4ff3fa23bea7980ff51f6f990bf33cda381ccedf2e572 |
|
MD5 | 3011c4829cfbed86582e54cc965245ad |
|
BLAKE2b-256 | 986c542731d425a8bbcff96cb2f8b7fbe06795a67ffd710bf7318f98636f9010 |