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

Uploaded Source

Built Distribution

apitally-0.1.2-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: apitally-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 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.1.2.tar.gz
Algorithm Hash digest
SHA256 25e8467c4a4439e6721dac7a7a58dc5a0a009875ede22e5f011a3f654ea65888
MD5 b740a574392d9435e343788eade3f34d
BLAKE2b-256 72e7af7eeeaf9e07598a07e3a2c5c28611149c8d81d788f809c6e04d146e8c6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apitally-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.0 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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5d57495993771bf25eac5538ad64aeadc89f5ed7693e0ffa8e68e6440286710
MD5 2a76f56f0efba03b5124ed73e73667c0
BLAKE2b-256 3959e0d5d040d1ca11cb3dfe6fe5f9216c5f2201fba147d0c37821844ac461e5

See more details on using hashes here.

Supported by

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