Skip to main content

Vulcano

Project description

Vulcano Code style: black Build Status codecov readthedocs py27build py34build py35build py36build py37build Downloads

What is Vulcano?

Vulcano is a framework for creating command line utils.

Here's a simple example:

from __future__ import print_function
from vulcano.app.classes import VulcanoApp


app = VulcanoApp()

@app.command("hi", "Salute people given form parameter")
def salute_method_here(name, title="Mr."):
    print("Hi! {} {} :) Glad to see you.".format(title, name))

@app.command
def i_am(name):
    app.context['name'] = name

@app.command
def whoami():
    print(app.context['name'])

@app.command
def bye(name="User"):
    """ Say goodbye to someone """
    print("Bye {}!".format(name))


if __name__ == '__main__':
    app.run()

This will create two commands:

  • hi: Registered by wrapping the salute_method_here
  • bye: Just registered directly with the bye function

And this will generate something like this:

Demo gif video

Nice, right?

Key features

  • Autocomplete: Vulcano will inspect all the functions you register, and will create a list of autocomplete with your command name and it's arguments.
  • Help: It will create help based on your functions docstrings or the help provided during the registration process.
  • History: Use up & down arrows to select a command from your history.
  • Register modules: It can register all the functions inside a module just by calling the register module function. It will help you to prevent modifying the source module.
  • Lexer: Of course, we use lexer with pygments to colorize your command line ;)
  • Nested commands: You want to execute more than one command at once from the command line arguments? Just use the "and". python your_script.py my_func arg=\"something\˝ and my_func_2 arg=\"another thing here\" , such hacker!
  • Context: If you want to communicate different functions between them, you can use the VulcanoApp.context (it's just a dictionary where you store and read data).

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

vulcano-0.1.3.tar.gz (11.0 kB view details)

Uploaded Source

File details

Details for the file vulcano-0.1.3.tar.gz.

File metadata

  • Download URL: vulcano-0.1.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for vulcano-0.1.3.tar.gz
Algorithm Hash digest
SHA256 132a3bbb0bfe5ba142597e911dd2f30b586a6916a88eedc64ddbedd3a871b4f2
MD5 321563e3318c66db6332a09e4306cccc
BLAKE2b-256 144039960e1dea54ee1328f32b076cc6a8fd8ca68900c855c94f77d1f20f72b3

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