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.4.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.4.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.4.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f06b59711c163e83b619b43824b96d3dea601a4a43d87187c6066de14c05c030 |
|
MD5 | f69a4a16aebc67dde925876eeb40f7b0 |
|
BLAKE2b-256 | 6a142beb4af3bff85adfbef6369958afd7aa864244b2e66b40f3bac41d22fb62 |
File details
Details for the file firefly_python-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.4-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe17ae2f81b143b24e485c9bb834ea2b0732fcbb1122648585e103455a57caf0 |
|
MD5 | 741b943190d26383d58db2bcadd26809 |
|
BLAKE2b-256 | d824e33b49246b7518b7ae958c74dfbe72d66b21eeaa2c42e72fceb8e9997a78 |