Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converts Readme from Markdown to ReStructured Text #67

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions Readme.md

This file was deleted.

70 changes: 70 additions & 0 deletions Readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Firefly
=======

.. image:: https://travis-ci.org/rorodata/firefly.svg?branch=master
:alt: Build Status
:target: https://travis-ci.org/rorodata/firefly

Function as a service.

How to install?
---------------

Install firefly from source using:

.. code-block:: bash

pip install firefly-python

How to use?
-----------

Create a simple python function.

.. code-block:: python

# fib.py

def fib(n):
if n == 0 or n == 1:
return 1
else:
return fib(n-1) + fib(n-2)

And run it using firefly.

.. code-block:: bash

$ firefly fib.fib
http://127.0.0.1:8000/
...

That started the fib function as a service listening at http://127.0.0.1:8000/.

Let us see how to use it with a client.

.. code-block:: python

>>> import firefly
>>> client = firefly.Client("http://127.0.0.1:8000/")
>>> client.square(n=4)
16

The service can also be invoked by sending a POST request.

.. code-block:: bash

$ curl -d '{"n": 10}' http://127.0.0.1:8000/fib
89

Documentation
-------------

http://firefly-python.readthedocs.io/

Features Planned
----------------

- Auto reload
- supporting other input and output content-types in addition to json. (for example, a function to resize an image)
- serverless deployment