8000 GitHub - u8sand/simple_commandify: Convert a set of python functions into a command-line application.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

u8sand/simple_commandify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple_commandify

Convert a set of python functions into a command-line application.

Features

  • Arg names equivalent to python function args
  • Type decorators preserved
  • Unsafe mode enables evaluating args as valid python
  • Auto help via doc-strings
  • just works: regardless of how you make your function / docstring

Usage

Step 1. Install simple_commandify

pip install simple_commandify

Step 2.

def your_functions(with_args: 'and decorators', of_all_types=None):
  ''' Your short description.
  Your long description / parameter annotations.
  '''
  # your actual process
  pass

# Add this to the bottom of your project
if __name__ == '__main__':
  import simple_commandify; simple_commandify.inject(globals())

Step 3. Profit

Alternatives

Future Direction

  • Use argparse (and argcomplete for auto completions) for more nicer operation

About

Convert a set of python functions into a command-line application.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0