1- # apilytics-python
1+ # Apilytics for Python
22
33[ ![ pypi] ( https://img.shields.io/pypi/v/apilytics )] ( https://pypi.org/project/apilytics/ )
44[ ![ ci] ( https://github.com/apilytics/apilytics-python/actions/workflows/ci.yml/badge.svg )] ( https://github.com/apilytics/apilytics-python/actions/workflows/ci.yml )
88[ ![ python versions] ( https://img.shields.io/pypi/pyversions/apilytics )] ( #what-python-versions-does-the-package-work-with )
99[ ![ license] ( https://img.shields.io/pypi/l/apilytics.svg )] ( https://github.com/apilytics/apilytics-python/blob/master/LICENSE )
1010
11- Apilytics is a service that lets you analyze operational, performance and security metrics from your APIs without infrastructure-level logging .
11+ Apilytics is a service that lets you analyze operational, performance and security metrics from your APIs easily .
1212
1313<img src =" https://www.apilytics.io/mock-ups/time-frame.gif " alt =" Apilytics dashboard animation " width =" 600 " height =" 300 " />
1414
@@ -17,18 +17,20 @@ Apilytics is a service that lets you analyze operational, performance and securi
17171 . Sign up and get your API key from https://apilytics.io - we offer a completely free trial with no credit card required!
1818
19192 . Install this package:
20+
2021``` sh
2122pip install apilytics
2223```
2324
24- 3 . Enable the middleware and set your API key:
25- * A good practice is to securely store the API key as an environment variable.
26- You can leave the env variable unset in e.g. development and test environments,
27- the middleware will be automatically disabled if the key is ` None ` .*
25+ 3 . Enable the middleware and set your API key:\
26+ _ A good practice is to securely store the API key as an environment variable.
27+ You can leave the env variable unset in e.g. development and test environments,
28+ the middleware will be automatically disabled if the key is ` None ` ._
2829
2930### Django
3031
3132` settings.py ` :
33+
3234``` python
3335import os
3436
@@ -59,6 +61,7 @@ app.add_middleware(ApilyticsMiddleware, api_key=os.getenv("APILYTICS_API_KEY"))
5961You can easily build your own middleware which measures the execution time and sends the metrics:
6062
6163` my_apilytics_middleware.py ` :
64+
6265``` python
6366import os
6467
@@ -85,7 +88,7 @@ def my_apilytics_middleware(request, get_response):
8588### Does the middleware slow down my backend?
8689
8790- No. The middleware does all of its requests to the Apilytics API in a background thread pool,
88- so it will not slow down your normal request handling.
91+ so it will not slow down your normal request handling.
8992
9093### What 3rd party dependencies does ` apilytics ` have?
9194
0 commit comments