deploying functions made easy
Project description
Firefly
-------
Firefly is a tool to expose Python functions as RESTful APIs.
Install
~~~~~~~
It can be installed using pip.
..code:: bash
$ pip install firefly-python
Usage
~~~~~
Write a python function:
..code:: python
# sq.py
def square(n):
return n*n
And run it with firefly:
..code:: bash
$ firefly sq.square
[2017-06-08 12:45:11 +0530] [20237] [INFO] Starting gunicorn 19.7.1
[2017-06-08 12:45:11 +0530] [20237] [INFO] Listening at: http://127.0.0.1:8000 (20237)
...
Firefly provides a simple client interface to interact with the server.
..code:: python
>>> from firefly.client import Client
>>> client = Client("http://127.0.0.1:8000")
>>> client.square(n=4)
16
Or, you can use the API directly:
..code:: bash
$ curl -d '{"n": 4}' http://127.0.0.1:8000/square
16
Links
~~~~~
* `Documentation <https://firefly-python.readthedocs.io/>`_
* `Github <https://github.com/rorodata/firefly>`_
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
firefly-python-0.1.6.tar.gz
(7.8 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.6.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.6.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bd0d230212fe2e1532ad6e59388572fc6c9dd9ff7e9d8442c5d23eba1a64b10 |
|
MD5 | bd9404ee4b272d57c6998fe006510f15 |
|
BLAKE2b-256 | bae83be73a05718f2991c37f0e72df716b12101218edda22415158b86d2ced0b |
File details
Details for the file firefly_python-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.6-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 801671f404810170607070435d6941425b7ccb5ec848b8151011f5dbf3b78178 |
|
MD5 | 366da4919f5b880de50138be11ac43f1 |
|
BLAKE2b-256 | 68e70d67cc3a8bbffe3127e98ecec0bac78661df922b468c6c806cb66dbae127 |