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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apylaas-0.1.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file apylaas-0.1.1.tar.gz.

File metadata

  • Download URL: apylaas-0.1.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for apylaas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 08c9fd85336ca4679d8e2390815827f2ba0ece8cc951e964e2a4fb5a3862f855
MD5 343b1c1caf8c095b5d44116e9f80ecff
BLAKE2b-256 63b6f857a8388454f9428bd46dd895cc3b100ec7f98f1a4ce41d53c02db180c4

See more details on using hashes here.

File details

Details for the file apylaas-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: apylaas-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for apylaas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b55bdcf1f34226abc54f5d8e5e4f2a53762f2f6f3a9ac84472fa8df7ce218e6f
MD5 b79b3adcbf6ed2a5c3d8e2c2b2f80d39
BLAKE2b-256 eaf5453d4efa30845821e7ea69623f0e20278304b3056f1b7eeaf9f86383c91b

See more details on using hashes here.

Supported by

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