Server-side AI bot tracking SDK for Python
Project description
surfgeo Python SDK
Track AI bot traffic on your Python servers with surfgeo.
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
Release history Release notifications | RSS feed
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.1.tar.gz
(12.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file surfgeo_sdk-1.0.1.tar.gz.
File metadata
- Download URL: surfgeo_sdk-1.0.1.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eccf048b2de9b2b95c2fddceb60bb5df7faf0b55e310d2a2d971b8adc9b81d5
|
|
| MD5 |
e8ff300a1900474b791e72659c0813f7
|
|
| BLAKE2b-256 |
2249a4113b9a89f87b645de0d2ecb42ebf50e8c56cef67ece23463ccb31d6269
|
File details
Details for the file surfgeo_sdk-1.0.1-py3-none-any.whl.
File metadata
- Download URL: surfgeo_sdk-1.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2018e70dd026f2574a170d1318989380ed610147818d846c1ade6e39a17ff645
|
|
| MD5 |
f4570b1a0eb2aae4405ace68dab2672a
|
|
| BLAKE2b-256 |
1796b4a6e835354dd16ced3fdeedc63e210b9b80db08e6b53075f6f6d399440b
|