Skip to main content

A Flask SDK for Apitoolkit integration

Project description

APItoolkit's Logo APItoolkit's Logo

Flask SDK

APItoolkit SDK PyPI - Version PyPI - Downloads Join Discord Server APItoolkit Docs

APItoolkit is an end-to-end API and web services management toolkit for engineers and customer support teams. To integrate your Flask (Python) application with APItoolkit, you need to use this SDK to monitor incoming traffic, aggregate the requests, and then deliver them to the APItoolkit's servers.


Table of Contents


Installation

Kindly run the command below to install the SDK:

pip install apitoolkit-flask

Configuration

Next, initialize APItoolkit in your application's entry point (e.g., main.py), like so:

from flask import Flask
from apitoolkit_flask import APIToolkit

app = Flask(__name__)

# Initialize APItoolkit
apitoolkit = APIToolkit(
    api_key = "{ENTER_YOUR_API_KEY_HERE}",
    debug = False,
    tags = ["environment: production", "region: us-east-1"],
    service_version = "v2.0"
)

@app.before_request
def before_request():
    apitoolkit.beforeRequest()

@app.after_request
def after_request(response):
    apitoolkit.afterRequest(response)
    return response
# END Initialize APItoolkit

@app.route('/hello', methods=['GET', 'POST'])
def sample_route():
    return {"Hello": "World"}

app.run(debug=True)

[!NOTE]

The {ENTER_YOUR_API_KEY_HERE} demo string should be replaced with the API key generated from the APItoolkit dashboard.


[!IMPORTANT]

To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this SDK documentation.

Contributing and Help

To contribute to the development of this SDK or request help from the community and our team, kindly do any of the following:

License

This repository is published under the MIT license.


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

apitoolkit-flask-1.0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

apitoolkit_flask-1.0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file apitoolkit-flask-1.0.1.tar.gz.

File metadata

  • Download URL: apitoolkit-flask-1.0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for apitoolkit-flask-1.0.1.tar.gz
Algorithm Hash digest
SHA256 114a59b4d220c18bbc25d51883dad0b4a9e9133ce74a90eb67e63e9c5ea44e3c
MD5 e4c9f68e0ce3a1fe70b1b21605bda17b
BLAKE2b-256 32068e9a57e7b612f28104e15382433aa698308c7a3767ee3237fa58109509a4

See more details on using hashes here.

File details

Details for the file apitoolkit_flask-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for apitoolkit_flask-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e39fa8301b16e02eee540f17b3b950b16735f86068e288ccfd3a8f6434f12de3
MD5 26e905da8c2aa9dd27720f8cb3c5576c
BLAKE2b-256 1bfd043fc81074de6e84471cd0d06e90e2f8de1875991e1ff26cc90da48cb75e

See more details on using hashes here.

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