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.7.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.7.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.7.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3892f24b0dd3b3676e88d39c0d00320298a3a2b431949fed2bbd6550cbf117b |
|
MD5 | df87e98b1a8e06ffa505004728d57a76 |
|
BLAKE2b-256 | 4f70d21db3eada34004f144e2a954388567b81813d509442062e2bd4709aacdc |
File details
Details for the file firefly_python-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.7-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ec207f9c3d024b097b4f9156ad590c0133232425d1577dc87f609dd8c76bd85 |
|
MD5 | 09732ab98c5ce18ad51eb50f5aa41e25 |
|
BLAKE2b-256 | 9ff0695618b4e8e9708cb16a475ad55d76137b57441f5a2970bf942ac1ffbc20 |