Skip to main content

Apitally client library for Python

Project description

Apitally logo

Your refreshingly simple REST API companion.

Apitally offers API traffic monitoring and integrated API key management that is extremely easy to set up and use with new and existing API projects. No assumptions made about your infrastructure, no extra tools for you to host and maintain, no data privacy worries.

🔗 apitally.io

Apitally screenshots


Apitally client for Python

Tests Codecov PyPI

This client library currently supports the following frameworks:

Install

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, flask, django_ninja and django_rest_framework.

Usage

Below are basic usage examples for each supported framework. For further instructions and examples, including how to identify consumers and use API key authentication, check out our documentation.

FastAPI

from fastapi import FastAPI
from apitally.fastapi import ApitallyMiddleware

app = FastAPI()
app.add_middleware(
    ApitallyMiddleware,
    client_id="your-client-id",
    env="your-env-name",
)

Starlette

from starlette.applications import Starlette
from apitally.starlette import ApitallyMiddleware

app = Starlette(routes=[...])
app.add_middleware(
    ApitallyMiddleware,
    client_id="your-client-id",
    env="your-env-name",
)

Flask

from flask import Flask
from apitally.flask import ApitallyMiddleware

app = Flask(__name__)
app.wsgi_app = ApitallyMiddleware(
    app,
    client_id="your-client-id",
    env="your-env-name",
)

Django Ninja

In your Django settings.py file:

MIDDLEWARE = [
    # Other middlewares first ...
    "apitally.django_ninja.ApitallyMiddleware",
]
APITALLY_MIDDLEWARE = {
    "client_id": "your-client-id",
    "env": "your-env-name",
}

Django REST Framework

In your Django settings.py file:

MIDDLEWARE = [
    # Other middlewares first ...
    "apitally.django_rest_framework.ApitallyMiddleware",
]
APITALLY_MIDDLEWARE = {
    "client_id": "your-client-id",
    "env": "your-env-name",
}

Getting help

If you need help please join our Apitally community on Slack or create a new discussion on GitHub.

License

This library is licensed under the terms of the MIT license.

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.3.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

apitally-0.3.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file apitally-0.3.1.tar.gz.

File metadata

  • Download URL: apitally-0.3.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1015-azure

File hashes

Hashes for apitally-0.3.1.tar.gz
Algorithm Hash digest
SHA256 477ee533e0cdab1bc70efac8961d9421e8c3eefee9334e0d830e15f47f08b2df
MD5 192d8af3fc06c5c0048da40dc5cf48ba
BLAKE2b-256 c327a346cce899fc84747ee9fd5863b2d2492e9ea23882448a865d35f087328b

See more details on using hashes here.

File details

Details for the file apitally-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: apitally-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1015-azure

File hashes

Hashes for apitally-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f29480dc88f52c31288257151e5a98b5f061da68e55a9a90d014e60fd337c8
MD5 a4d363069a152aec6db44345ce36fc3c
BLAKE2b-256 ec657ac8bdfa1aac329e6c81d087e89624677b10cf7b025837a34f6492cded69

See more details on using hashes here.

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