Skip to main content

It is a modern args catching with python3 and OOP structure and implementation.

Project description

Why SmileArgs

It is a modern args catching with python3 and OOP structure and implementation.

Optional

Some parameters will clarify more, when instance starting

smile = SmileArgs(allowNoValue= False, duplicated= False, console= True, debug= False)
  • allowNoValue: bool= False | True
    • No require value on args
    • -c command does not need any assign value (Ex: python test.py -c)
  • duplicated: bool= False | True
    • Allowing a user types many times of any command on args (Ex: python test.py -b -b -b)
    • Will execute 3 times of the command "-b" regarding to the above example
  • console: bool= False | True
    • A method will print error when the system catches and throw a particular error
  • debug bool= False | True
    • This property will track any prompt while working

Example

create a test.py

from SmileArgs import SmileArgs
smile   = SmileArgs()

smile.addCommand('a', 'alphabet', 'show alphabet')
smile.addCommand('b', 'barbie', 'Wow, movies')
smile.addCommand('m', 'miss', 'miss mom everyday')
smile.run()

cli

$ python test.py -a -ab -a --miss=mom

it will catch '-a' as a short command, and '--miss' as a long command; then use match or if statement to control those states.

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

SmileArgs-1.0.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

SmileArgs-1.0.0-py3-none-any.whl (2.6 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