This is a helper module to allow you to capture all the request/response which comes to your Flask app.
pip install flask-cdc-devlibx
How to use
from flask_cdc import cdc
# We expect you already have the flask app
app = "Existing flask"
# Recorder is called everytime you get request response. You can do anything you want
# In this example we have logged data with a helper function provided by cdc. You can change
# this method to do anything else
def recorder(state):
cdc.log_results(state)
# Wrap app to your session record MW
app.wsgi_app = cdc.SessionRecorderMiddleware(app.wsgi_app, recorder)
How to enable CDC
Set following env variable:
export CDC_KAFKA=<your kafka broker>
export CDC_TOPIC=<your kafka topic for CDC>
You can use the pre-defined recorder to send data to kafka:
app.wsgi_app = cdc.SessionRecorderMiddleware(app.wsgi_app, cdc.publish_result_to_kafka)
Once it is defined then you can see the following data in your topic
{
"request": {
"body": {
"archive_existing_versions": true,
"name": "harish",
"stage": "Staging",
"version": "2"
},
"method": "POST",
"url": "/ajax-api/2.0/preview/mlflow/model-versions/transition-stage"
},
"response": {
"status": "200 OK"
}
}
Metadata
Release files for flask-cdc-devlibx 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flask-cdc-devlibx-0.0.11.tar.gz | 5.1 kB | Without provenance | Details for flask-cdc-devlibx-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flask_cdc_devlibx-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for flask_cdc_devlibx-0.0.11-py3-none-any.whl |
Total release size: 10.3 kB
Release files / flask-cdc-devlibx-0.0.11.tar.gz
| Download URL | flask-cdc-devlibx-0.0.11.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d28388e5187455496fecaa176782b601db81909b1212a7f64f2046f7114411a
|
|
BLAKE2b-256 checksum How to use checksums |
75975c656709808e64e22c3ec1b6056a3b8bc267ab23bb6327970893997a0480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / flask_cdc_devlibx-0.0.11-py3-none-any.whl
| Download URL | flask_cdc_devlibx-0.0.11-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2ed71f9af277d6505b66ac44b6100e4a7045adfdd59bba05194d1bd9bf2a01b
|
|
BLAKE2b-256 checksum How to use checksums |
03d4a7d0bd227a927eece31ecc8a3f35104f540917fe3aaa94280b24169fd885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for flask-cdc-devlibx 0.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.