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.8.tar.gz
(8.3 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.8.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.8.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb33f250a326658dd1ac493f5021de6d40a02d4b54d4f240bf9adb1e9e118e83 |
|
MD5 | 9153a3cb2ec1dda2dff053ef5315f828 |
|
BLAKE2b-256 | b8a8684c6bbe8b3c9f9fab008952b4615e72a76d8c668c50e8e4e9c497c32c95 |
File details
Details for the file firefly_python-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.8-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d97f0d5b4cf8173d148c8f9b426d5888010b7948ca1cd042c158656b7d83b32 |
|
MD5 | d06ef7165e4dd46b57a6dc4c4ceedc41 |
|
BLAKE2b-256 | 1d464a8bf7d4211772b48bb71f438bd8ffb362320bf33bb458b1e3bd1d0890ce |