firefly-python-0.1.9
توضیحات
deploying functions made easy
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | firefly-python-0.1.9 |
| نام | firefly-python |
| نسخه کتابخانه | 0.1.9 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | rorodata |
| ایمیل نویسنده | rorodata.team@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/firefly-python/ |
| مجوز | - |
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>`_
نحوه نصب
نصب پکیج whl firefly-python-0.1.9:
pip install firefly-python-0.1.9.whl
نصب پکیج tar.gz firefly-python-0.1.9:
pip install firefly-python-0.1.9.tar.gz