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.

🔗 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.2.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

apitally-0.2.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitally-0.2.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.12 Linux/6.2.0-1014-azure

File hashes

Hashes for apitally-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ee5e797647c50e54cd0ec160141149229108122a24a67d7eae318c74816c24d5
MD5 866095a50f296a375b03424500bf6596
BLAKE2b-256 138dc3e7b92c831aaa56853b11c6c2f92dfc0e96c096c83e7653ce47f84242b1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for apitally-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f9c697fe6308cea6ac3cb4c46ea6ba603cb735848a986b4a4512c083192dabc
MD5 871eeafcb359429e42b8157e208e79bf
BLAKE2b-256 d014c23ec0d0c09f8bdca7cc825ae4edb3726538d18fabdfc034d409dd767fa7

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