Skip to main content

collection of handy methods for terminal applications

Project description

Rambo

A few helpful tools for creating terminal applications

Rambo is a collection of methods to help with mapping terminal program arguments to python actions / functions

Getting started pip install rambo-py

creating a project rambo init project

This will create a directory called actions as well as a file called rambo.yml which functions both at the terminal config file, and mapper configuration

Example rambo.yml

commands:
  action:
    help: "available options for the rambo action argument"
    choices:
      - init
      - delete
  object:
    help: "available options for the rambo object argument"
    choices:
      - project
      - file

Rambo commands follow the pattern of action -> object where the action argument will be performed on the provided object. in the above example the following combinations are valid

init project
init file
delete project
delete file

these argument combinations can be mapped to actions which are python functions. Rambo will map these valid combinations to functions of the same name.

Rambo Decorators

Rambo provides handy decorator methods to access the passed in cmd arguments, rambo.yml config file and function key value

Provides the rambo.yml config file as a dictionary to the decorated function.

@provide_config(path = this is optional)
def my_cool_func(confg):
	# do things with config here

Provides the namespace object to the decorated function with the commands available in rambo.yml

@provide_cmd_args
def another_cool_func(cmd_args):
	# do some things with the arguments in the argparser

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rambo-py, version 1.0.5
Filename, size File type Python version Upload date Hashes
Filename, size rambo-py-1.0.5.macosx-10.9-x86_64.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View
Filename, size rambo_py-1.0.5-py3-none-any.whl (6.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page