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
- Host: GitHub
- URL: https://github.com/sslotin/autofire
- Owner: sslotin
- License: wtfpl
- Created: 2019-04-02T17:03:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-23T20:58:37.000Z (about 7 years ago)
- Last Synced: 2024-11-01T22:38:47.732Z (over 1 year ago)
- Topics: cli, python
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```