Skip to main content

Server-side AI bot tracking SDK for Python

Project description

surfgeo Python SDK

Track AI bot traffic on your Python servers with surfgeo.

PyPI version Python versions License: MIT

Installation

pip install surfgeo-sdk

Framework-Specific Installation

# Django
pip install surfgeo-sdk[django]

# Flask
pip install surfgeo-sdk[flask]

# FastAPI
pip install surfgeo-sdk[fastapi]

Quick Start

Django

# settings.py
MIDDLEWARE = [
    # ... other middleware
    'surfgeo.middleware.django.surfgeoMiddleware',
]

SURFGEO_CONFIG = {
    'script_key': 'sk_your_key_here'
}

Flask

from flask import Flask
from surfgeo import get_flask_extension

app = Flask(__name__)
SurfGeo = get_flask_extension()
surfgeo = SurfGeo(app, script_key='sk_your_key_here')

FastAPI

from fastapi import FastAPI
from surfgeo.middleware.fastapi import surfgeoMiddleware

app = FastAPI()
app.add_middleware(
    surfgeoMiddleware,
    script_key='sk_your_key_here'
)

Configuration Options

Option Type Required Default Description
script_key str Yes - Your surfgeo script key
endpoint str No Production Custom tracking endpoint
timeout float No 0.05 Request timeout (seconds)
debug bool No False Enable debug logging
enabled bool No True Enable/disable tracking

Features

  • ✅ Zero impact on app performance (non-blocking)
  • ✅ Async and sync framework support
  • ✅ Works with Django, Flask, FastAPI, and more
  • ✅ Type hints and modern Python (3.8+)
  • ✅ Comprehensive test coverage

Documentation

License

MIT

Support

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

surfgeo_sdk-1.0.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

surfgeo_sdk-1.0.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file surfgeo_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: surfgeo_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for surfgeo_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1c6bde62bc40b70c4d326b36432d37473081ec04728320483ccc3477c1648fd4
MD5 9d98311fcffbd0ff6632dee4b5139488
BLAKE2b-256 27ab12c3be24d24b14ae2a0a35feca35cc3dc5318cd124926cde3408abb352e1

See more details on using hashes here.

File details

Details for the file surfgeo_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: surfgeo_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for surfgeo_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c135290a08fa156a82f35b1616132371c121d71f910131433034fc86fcede982
MD5 f53c444e52422b582141263c18147032
BLAKE2b-256 decb7fd4eabacee2a967387e9fcd2a7c448258ed15262e7edaff23ad1289fce9

See more details on using hashes here.

Supported by

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