Skip to main content

Serve Python functions as web APIs

Project description

https://travis-ci.org/acroz/funcportal.svg?branch=master https://badge.fury.io/py/funcportal.svg

funcportal runs your Python functions as a web API, with no code changes required.

Usage

Given a Python module like code.py below:

# code.py
def hello(name):
    return f'Hello, {name}!'

You can serve the function hello() as a web API with funcportal on the command line:

$ funcportal code:hello

and you can then make HTTP POST requests to it, for example with the Python requests library:

>>> import requests
>>> response = requests.post(
>>>     'http://localhost:5000/hello',
>>>     json={'name': 'Jane'}
>>> )
>>> result = response.json()['result']
>>> print(result)
Hello, Jane!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funcportal-0.1.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

funcportal-0.1.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page