Skip to main content

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


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 hashes)

Uploaded Source

ezcliy-0.3.1-py3-none-any.whl (8.4 kB view hashes)

Uploaded 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