Skip to main content

Any Python Library As A Service

Project description

Any Python Library As A Service (apylaas)

apylaas lets you host Python libraries behind a web service with a JSON API and a simple web UI. This can be useful for remotely executing Python code with some inputs or debugging code outside of a terminal. Read this post for details.

Installation

pip install apylaas

Usage

apylaas --help

apylaas --library some_module

Details

cat <<EOF > something.py
def say_hello(name: str) -> str:
    return f"Hello {name}!"
EOF

apylaas --library something

# Visit http://localhost:5000/say_hello
# or use the API directly (both GET and POST are accepted)
curl -X POST -d '{"name": "someone"}' http://localhost:5000/say_hello
curl 'http://localhost:5000/say_hello?name=someone'

See examples/basic.py for a simple demo of hosting a function that takes in and returns strings. See examples/classifier.py for a simple PyTorch model server.

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

apylaas-0.1.1.tar.gz (20.1 kB view hashes)

Uploaded Source

Built Distribution

apylaas-0.1.1-py3-none-any.whl (21.8 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