An open API service indexing awesome lists of open source software.

https://github.com/sslotin/autofire

Tiny tool for calling arbitrary Python functions via an auto-generated CLI
https://github.com/sslotin/autofire

cli python

Last synced: about 1 year ago
JSON representation

Tiny tool for calling arbitrary Python functions via an auto-generated CLI

Awesome Lists containing this project

README

          

# Autofire

Ridiculously small package that allows creating command line interfaces in O(0) time with Google's [Python Fire](https://github.com/google/python-fire).

To install with pip, run: `pip install autofire`

## Usage

Say you have a file `example.py`:

```python
def sum(a, b):
return a + b

class Calculator:
def double(self, some_number):
return 2*some_number

import math
```

Then, from the command line, you can just run:

```bash
fire example.py sum 2 3
fire example.py Calculator double 5
fire example.py Calculator double --some_number=15
fire example.py math log 6
```