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.1.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file firefly-python-0.1.1.tar.gz
.
File metadata
- Download URL: firefly-python-0.1.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533d579bc3f9e21b2821fcefc5c8036348a930330022fe05b23bc4e62ed4e65d |
|
MD5 | d9d6773f9f6f328e39302207bbd1448c |
|
BLAKE2b-256 | a2613aa0bd6d994e3926d407e4832135cc4e48a936f9258bf1a2f1ad92f91df9 |
File details
Details for the file firefly_python-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: firefly_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad45ed5845b2a3dbae3f47c5f07913dfd31405e8f95e99fdbdeddd479171e98 |
|
MD5 | 3415b96bf897ef89d9a17f1c519aa6ef |
|
BLAKE2b-256 | 9c1ed67cd16606c025428635d7e9c5e4e74402b86f1358ff55239270b38f1f2b |