Responsible AI Core Flask Wrapper
Project description
wrapped-flask
Provide environment detection for enabling Flask server without configuring at instantiation. Environments are implemented as classes that will either return None if the environment check fails, or return an object with all the appropriate environment settings if the check passes. The flask service can then use it to build out urls, attach required headers, and render inline visualizations with the correct methods.
Installation
pip install -e .
Usage
from rai_core_flask import FlaskHelper
flask_service = FlaskHelper(ip=<ip-to-listen-on>, port=<port-to-listen-on>)
If ip
is not specified then it listens on localhost
by default.
If port
is not specified then it finds an open port in the range 5000 to 5099
and listens on it.
To register a function to listen on an route:
@flask_service.app.route("/your-api-route/<int:param_name>", methods=["GET", "POST"])
def my_func(param_name):
return something
Release Process
- Increment the version number in
setup.py
- Activate your virtual environment.
- Run the
release.sh
script.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rai_core_flask-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23842ead6f7f59040c49f502cee85540d6c920fc6eadd472f3ada791883ad515 |
|
MD5 | 8f3deb8625b414bdc545424a58f2edcc |
|
BLAKE2b-256 | fe81a13432b11c3daaee8fa36f2857d7db6d80a85baf5b059f241be0f03d9dd7 |