Adapter to run an Azure Function Application with a WSGI Web Server.
Project description
Cactus
Adapter to run an Azure Function Application with a WSGI Web Server.
How it works
Given the path of a folder containing a Function App, it builds a WSGI App parsing the Function settings. The app simply calls the Function main according to the route/methods settings.
Supported Function
This software is meant to support only Function which use binding httpTrigger as input and http as output. No other binding types. This is not an Azure emulator.
Function App structure
FunctionApp
|-- host.json
|-- function_1
| |-- function.json
| |-- __init__.py
|-- function_2
| |-- function.json
| |-- __init__.py
Installing
pip install pycactus
How to run
Create a file "wsgi.py"
from cactus.appfactory import build_app
app = build_app("YourFunctionAppFolder")
Run it with a WSGI Web Server
gunicorn wsgi:app
Checkout the examples for more.
Testing
This module is tested using Fir WSGI client.
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install requirements
pip install -r requirements -r test-requirements
# Run tests with coverage
python -m pytest tests --cov=cactus
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
pycactus-0.0.7.tar.gz
(4.8 kB
view details)
File details
Details for the file pycactus-0.0.7.tar.gz
.
File metadata
- Download URL: pycactus-0.0.7.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.4.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5604281fa715dd16eabcac312c1cf2e17e00cc6e8f28f4fc1a21e4874eb08390 |
|
MD5 | 6178fadc2ee9e0a47046bab83e3e9bc8 |
|
BLAKE2b-256 | 8bfd88920a92bcf63d841a48cc36b554b57b1242411645c13135af12a11e65a5 |