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-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcea1ff0aff4ff7910fdfe6359baf3b4cdb456c5256ba1b43315737de38595d1 |
|
MD5 | 9a9cddd9d3085ee045170f476db7c605 |
|
BLAKE2b-256 | f49da92afab46cad54388e88c90e3a4045d7dd0e46017fda58edfdda44fe375d |
File details
Details for the file apitoolkit_flask-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: apitoolkit_flask-0.4.0-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 | 5dd91d1c748e0ace4bad1d176cde2c9692906a634f6f90fdbed2977ad794f739 |
|
MD5 | d756cffa811649b96b9ecb1157dc5aba |
|
BLAKE2b-256 | 5411955a0ecdd10228607c28896d037ea2f0ddd22f19c2a720bd2ece4b9d2a05 |