Skip to main content

Responsible AI Core Flask Wrapper

Project description

rai_core_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 8704 to 8993 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

  1. Increment the version number in setup.py
  2. Activate your virtual environment.
  3. Run the release.sh script.

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

rai_core_flask-0.7.6.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

rai_core_flask-0.7.6-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file rai_core_flask-0.7.6.tar.gz.

File metadata

  • Download URL: rai_core_flask-0.7.6.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for rai_core_flask-0.7.6.tar.gz
Algorithm Hash digest
SHA256 13233a182ec42860103d22c6617457ff2a26ed3813aae36ae697a0504a470ef1
MD5 9469e5768746064b8ee33ee45d887828
BLAKE2b-256 0c5327788e2a5f3317b4c5172f70b1d71f87fc2f4f311378d6ba6ccd847f942d

See more details on using hashes here.

File details

Details for the file rai_core_flask-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: rai_core_flask-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for rai_core_flask-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 63afd1d9ea864e8540fb012e908387063f5a9d17e705cbc32a3be69c090df32e
MD5 4a65bdc00b506297ae6553a178ba33fd
BLAKE2b-256 35f9645e2fa6f96b1152e2f69248884338cc9c1118d4f71cab6ae994651de789

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