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.10.tar.gz
(8.5 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.10.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.10.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2e45251d00bfe9492ab33eac4ea45c05cc61e86a90cc1b2f489bc4603023c5 |
|
MD5 | 0c30a174fded0b2da6fa8916c3b6bbc9 |
|
BLAKE2b-256 | 52f1c7fe08ab7bc4b960830eb0bd2ca6d7874163943844619451a4dab5085728 |
File details
Details for the file firefly_python-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.10-py3-none-any.whl
- Upload date:
- Size: 12.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0d3f6c6e8bdcf2ce913f00a26a9dd6a9c498c5f0a45f8eb749f12c4c85488b |
|
MD5 | a292bef5ef91641bd2db05bdb238e9a6 |
|
BLAKE2b-256 | 4d597e1985b60a8c7cdc7f513f03b6d26559576047321b3de37075428913ba74 |