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-0.4.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitoolkit-flask-0.4.0.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-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bcea1ff0aff4ff7910fdfe6359baf3b4cdb456c5256ba1b43315737de38595d1
MD5 9a9cddd9d3085ee045170f476db7c605
BLAKE2b-256 f49da92afab46cad54388e88c90e3a4045d7dd0e46017fda58edfdda44fe375d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for apitoolkit_flask-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dd91d1c748e0ace4bad1d176cde2c9692906a634f6f90fdbed2977ad794f739
MD5 d756cffa811649b96b9ecb1157dc5aba
BLAKE2b-256 5411955a0ecdd10228607c28896d037ea2f0ddd22f19c2a720bd2ece4b9d2a05

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