Apitally client library for Python
Project description
Apitally client for Python
Apitally client library for Python.
Currently supports the following frameworks:
Installation
Use pip
to install and provide your framework of choice as an extra, for example:
pip install apitally[fastapi]
The available extras are: fastapi
, starlette
, django_ninja
, django_rest_framework
and flask
.
Basic usage
Below are basic usage examples for each supported framework. For more detailed instructions and examples, including on how to use Apitally API key authentication, see the documentation.
With FastAPI
from fastapi import FastAPI
from apitally.fastapi import ApitallyMiddleware
app = FastAPI()
app.add_middleware(ApitallyMiddleware, client_id="<your-client-id>")
With Starlette
from starlette.applications import Starlette
from apitally.starlette import ApitallyMiddleware
app = Starlette()
app.add_middleware(ApitallyMiddleware, client_id="<your-client-id>")
With Django Ninja
In your Django settings.py
file:
MIDDLEWARE = [
"apitally.django_ninja.ApitallyMiddleware",
]
APITALLY_MIDDLEWARE = {
"client_id": "<your-client-id>",
}
With Django REST Framework
In your Django settings.py
file:
MIDDLEWARE = [
"apitally.django_rest_framework.ApitallyMiddleware",
]
APITALLY_MIDDLEWARE = {
"client_id": "<your-client-id>",
}
With Flask
from flask import Flask
from apitally.flask import ApitallyMiddleware
app = Flask(__name__)
app.wsgi_app = ApitallyMiddleware(app, client_id="<your-client-id>")
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
apitally-0.1.0.tar.gz
(14.3 kB
view hashes)
Built Distribution
apitally-0.1.0-py3-none-any.whl
(19.3 kB
view hashes)