Skip to main content

Apitally client library for Python

Project description

Apitally client for Python

Tests Codecov PyPI

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


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)

Uploaded Source

Built Distribution

apitally-0.1.0-py3-none-any.whl (19.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page