Skip to main content

Official Python SDK for FingerprintIQ — visitor identification, API caller classification, and CLI usage analytics

Project description

fingerprintiq

PyPI Python Downloads License

Official Python SDK for FingerprintIQ — three products in one package:

  • Identify — server-side visitor lookup
  • Sentinel — classify API callers as browsers, AI agents, CLI tools, or bots
  • Pulse — CLI usage analytics and machine fingerprinting

Links: Docs · PyPI · Issues

Installation

pip install fingerprintiq              # core (Identify + Sentinel + Pulse)
pip install 'fingerprintiq[fastapi]'   # + FastAPI / Starlette middleware

Requires Python 3.9+.

Identify — server-side visitor lookup

from fingerprintiq import FingerprintIQ

with FingerprintIQ(api_key="fiq_live_...") as client:
    visitor = client.lookup(visitor_id="iq_abc123")
    print(visitor.visitor_id, visitor.bot_probability)

Async variant:

import asyncio
from fingerprintiq import FingerprintIQ

async def main() -> None:
    client = FingerprintIQ(api_key="fiq_live_...")
    try:
        visitor = await client.alookup(visitor_id="iq_abc123")
        print(visitor.bot_probability)
    finally:
        await client.aclose()

asyncio.run(main())

Sentinel — FastAPI middleware

from fastapi import FastAPI, Request
from fingerprintiq.sentinel.fastapi import SentinelMiddleware

app = FastAPI()
app.add_middleware(
    SentinelMiddleware,
    api_key="fiq_live_...",
    mode="blocking",
    timeout=1.0,
)

@app.get("/api/data")
def handler(request: Request):
    result = request.state.sentinel  # SentinelResult | None
    if result and result.caller_type == "bot":
        return {"blocked": True}
    return {"ok": True}

The default middleware mode is "background" so FingerprintIQ inspection does not add network latency to the request path. Use mode="blocking" only when the handler needs request.state.sentinel before responding.

Pulse — CLI analytics

from fingerprintiq.pulse import Pulse

pulse = Pulse(api_key="fiq_live_...", tool="my-cli", version="1.2.3")
pulse.track("deploy", metadata={"duration_ms": 1234, "success": True})
pulse.shutdown()  # or let atexit handle it

Honors DO_NOT_TRACK=1 and FINGERPRINTIQ_OPTOUT=1 out of the box. Set respect_opt_out=False to override.

Sibling Packages

Package Purpose
fingerprintiq (PyPI) Python SDK — Identify, Sentinel, Pulse (this package)
@fingerprintiq/js Browser fingerprinting
@fingerprintiq/server Server-side caller classification (Hono, Express)
@fingerprintiq/pulse Node CLI usage analytics

Contributing

This repo is a read-only public mirror. The master copy lives in the private FingerprintIQ monorepo and is synced here on every push to main. Please file issues rather than PRs.

License

MIT

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

fingerprintiq-0.2.0.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

fingerprintiq-0.2.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fingerprintiq-0.2.0.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fingerprintiq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e9845abdc666a95ff82cf098c933d2c3df6915b0a5d55c649eab044a5f4fc2d0
MD5 31903e2d4a0d19419c1eb4f74c275601
BLAKE2b-256 71ca693b24d45b327be20eaf1bd390f0f61835573440c5d8c7e9289eb6a0f1eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fingerprintiq-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fingerprintiq-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 744ca401d4424d0d8fd1f67ac17bba419b5269ff42c5bff52fffa1def37ff4fe
MD5 af9b18d787e3c9d761fe5cf80e8ed2cc
BLAKE2b-256 585b8400c9723a9d525b65cf2f93e387ae84bd8e40573dd529fceb8381b4bd83

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