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.2.tar.gz
(6.2 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.2.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af6fa25691361e12ee711c12b2473c165b4cca7a40ec83641c32558f798eec3d |
|
MD5 | 2bf608685a1e15eef66249e70792483c |
|
BLAKE2b-256 | c4f0fddbac6059789240e7058bc41b1c2058fe599b7433ec957e61d24eeb52ae |
File details
Details for the file firefly_python-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 568006823f1efa325e121ce6866f3b7fac3964472261e19eaa4b161a22cbb3cc |
|
MD5 | 05489ed8ff6214f82ffb65d246c2fa0f |
|
BLAKE2b-256 | 000b7c69186097ebcc880ee57e81dd9a0f3810e7b95c45e28777d1a84c391b3d |