Skip to main content

This is your kommand, CLI interactive with python

Project description

Kommand!

GitHub GitHub issues

This is your kommand!, this package is used to interactively control your function in CL.

Get started

Requirement:

  • Python >= 3.6
  • colorama (just for color in command line)

How to install kommand:

python setup.py install

How to use kommand:

# this will build json templates for your command information.
python -m kommand build

after that you just have to fill your command information in your json file.

{
    "name": "myapp",
    "version": "0.1",
    "description": "kom test",
    "author": "kzulfazriawan",
    "email": "kzulfazriawan@gmail.com",
    "your_command": {
        "exec": "module_to_exec",
        "help": "help information"
    },
    "your_command2": {
        "exec": "module_to_exec2",
        "help": "help information2"
    }
}

In your script python you can add

from kommand import control

if __name__ == '__main__':
    control(json_file='your_file.json')
    # OR you can use with dictionary arguments
    control(
        name='your_project_name',
        version='0.1',
        your_command={'exec': 'your_module_exec', 'help': 'help information'},
        your_command2={'exec': 'your_module_exec2', 'help': 'help information2'},...
    )

Then start execute your script in command line:

python myscript.py

# to see help
python myscript.py help

# to execute
python myscript.py your_command your_command2
python myscript.py your_command2 your_command
python myscript.py your_command2
python myscript.py your_command

# if use parameter
python myscript.py your_command='p1,p2,...'

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

kommand-1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distributions

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

kommand-1.0-py3.10.egg (8.2 kB view details)

Uploaded Egg

kommand-1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file kommand-1.0.tar.gz.

File metadata

  • Download URL: kommand-1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for kommand-1.0.tar.gz
Algorithm Hash digest
SHA256 c0c665a3211946a83eeb37ff6ea1190f2f8e197f8fa24d4c05e5394becc10ea5
MD5 55836b186eb66e6a0a1bb88e53133f0f
BLAKE2b-256 abf397dc5f21e391742b453cc5984a948be2bde54be3289c605c06e1bdefbbb7

See more details on using hashes here.

File details

Details for the file kommand-1.0-py3.10.egg.

File metadata

  • Download URL: kommand-1.0-py3.10.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for kommand-1.0-py3.10.egg
Algorithm Hash digest
SHA256 de5c02ba2394d47d5220c9d15343a73b0fc12dab8c3c2abad1ed24e76c9b664c
MD5 d5db48b6132e87bff3a1fc3d2d0b8574
BLAKE2b-256 27fabd99e981881b83214e1db7e9a54623ad4bf605a6a4ac041dd324fbcb084d

See more details on using hashes here.

File details

Details for the file kommand-1.0-py3-none-any.whl.

File metadata

  • Download URL: kommand-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for kommand-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc8abb63cd91c0607166efcec6422244dc7b77842cb971e4725982e8f9c759e2
MD5 b8e2cfe037444e5a09b0d4f835facff2
BLAKE2b-256 bc1e7eca492a1067c65e75eeb359b5a3215d854b24c7a209f481213dc3c9278f

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