A Flask SDK for Apitoolkit integration
Project description
Flask SDK
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:
- Read our Contributors Guide.
- Join our community Discord Server.
- Create a new issue in this repository.
License
This repository is published under the MIT license.
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 114a59b4d220c18bbc25d51883dad0b4a9e9133ce74a90eb67e63e9c5ea44e3c |
|
MD5 | e4c9f68e0ce3a1fe70b1b21605bda17b |
|
BLAKE2b-256 | 32068e9a57e7b612f28104e15382433aa698308c7a3767ee3237fa58109509a4 |
File details
Details for the file apitoolkit_flask-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: apitoolkit_flask-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e39fa8301b16e02eee540f17b3b950b16735f86068e288ccfd3a8f6434f12de3 |
|
MD5 | 26e905da8c2aa9dd27720f8cb3c5576c |
|
BLAKE2b-256 | 1bfd043fc81074de6e84471cd0d06e90e2f8de1875991e1ff26cc90da48cb75e |