Skip to main content

Create simple commands.

Project description

Simplipy-Python

How to use

Command

from simplipy_python import Command

def PrintArgs(Arguments):
    print(Arguments)

CommandHandler = Command(CommandMessage="Run> ", StarterMessage=None) # StarterMessage is Optional.
CommandHandler.AddCommand(command_name="Print Arguments", command_function=PrintArgs)
CommandHandler.SetupCommands() # Setup Command Module.

It should look like this:
Image of what it'll look like

Category

from simplipy_python import Command, Category

def PrintArgs(Arguments):
    print(Arguments)

def PrintArgsCategory(Arguments):
    print(f"Category {Arguments}")

CommandHandler = Command(CommandMessage="Run> ", StarterMessage="Category Test!!!")
CommandHandler.AddCommand(command_name="Print Arguments", command_function=PrintArgs)

Category1 = Category(category_name="Other Functions") # Create Category
Category1.AddCommand(command_name="Print Arguments 1", command_function=PrintArgsCategory) # Add Function

CommandHandler.SetupCommands(Categories=[Category1]) # Inject the Categories into the Setup

BEFORE TRYING THIS, PLEASE TYPE IN THE CATEGORY NAME
Case Sensitive

Commands Run> Other-Functions

Should look like this:
Image of what it'll look like

Help Command

$ python filename.py -h

usage: prog.py [-h] [--changelog]

options:
  -h, --help     show this help message and exit
  -cl, --changelog      The python package's changelog

Exceptions

NotValidCommand

Is raised when you input an invalid Command.

CommandNameAlreadyExists

Is raised when you make a Command have the same name as another.

FunctionAlreadyExists

Is raised when you try to pass the same function into a different Command.

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

simplipy-python-0.1.7.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

simplipy_python-0.1.7-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file simplipy-python-0.1.7.tar.gz.

File metadata

  • Download URL: simplipy-python-0.1.7.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for simplipy-python-0.1.7.tar.gz
Algorithm Hash digest
SHA256 bfde5d3270a41b547c50a54dd5c32443a3d19e0e34fa646ba76c8c7e35333b56
MD5 fde2efc23d0be25cac759f5b39595c84
BLAKE2b-256 68b59186da93d914e0e55be4b9e733430d38581fd34453eaae1913eb52db5adf

See more details on using hashes here.

File details

Details for the file simplipy_python-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for simplipy_python-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7e2e86698041e41ea8cdfe7320aee1c0e5b0204d2b321aa400fb9103d01b39d8
MD5 fe3c47637182a153c045223f7540e582
BLAKE2b-256 1a07f5f1d1e8de113fc0d8f5840b50e4c2858286eb42a9a3ab1cbbe2862f49aa

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