Open-Source Python Middleware for Digital Fingerprinting
Project description
FP-Devicer
Developed by Gateway Corporate Solutions LLC
FP-Devicer is a digital fingerprinting middleware library designed for ease of use and near-universal compatibility with servers.
Usage
Importing and using the library to compare fingerprints between users is as simple as collecting user data and running a confidence calculation.
# 1. Simple method (using defaults)
from devicer import calculate_confidence
score = calculate_confidence(fp_data_1, fp_data_2)
# 2. Advanced method (custom weights & comparators)
from devicer import ComparisonOptions, create_confidence_calculator, register_plugin
from devicer.libs.comparators import levenshtein_similarity
register_plugin(
"userAgent",
weight=25,
comparator=lambda a, b, _path=None: levenshtein_similarity(
str(a or "").lower(),
str(b or "").lower(),
),
)
advanced_calculator = create_confidence_calculator(
ComparisonOptions(
weights={
"platform": 20,
"fonts": 20,
"screen": 15,
},
)
)
advanced_score = advanced_calculator.calculate_confidence(fp_data_1, fp_data_2)
For storage-backed identification flows:
import asyncio
from devicer import DeviceManager, create_in_memory_adapter
async def main() -> None:
adapter = create_in_memory_adapter()
await adapter.init()
manager = DeviceManager(adapter)
result = await manager.identify(
{
"userAgent": "Mozilla/5.0",
"platform": "Linux x86_64",
"languages": ["en-US", "en"],
},
user_id="user-1",
ip="127.0.0.1",
)
print(result) # -> IdentifyResult(device_id=..., confidence=..., is_new_device=...)
asyncio.run(main())
The resulting confidence ranges between 0 and 100, where 100 is the strongest match.
Quickstart
Install and run the Python package:
pip install devicer.py
python -c "from devicer import calculate_confidence; print(calculate_confidence({'platform':'Win32'},{'platform':'Win32'}))"
For local development:
pip install -e .[dev]
pytest -q
Adapters
Built-in adapters:
create_in_memory_adapter()create_sqlite_adapter(path)create_postgres_adapter(dsn)(requires optionalpostgresextras)create_redis_adapter(url)(requires optionalredisextras)
Install optional adapter dependencies:
pip install -e .[postgres]
pip install -e .[redis]
Benchmarks
You can run benchmark parity scripts for performance and accuracy:
python -m devicer.benchmarks.performance_bench
python -m devicer.benchmarks.accuracy_bench
Outputs are written to:
src/devicer/benchmarks/performance.bench.outsrc/devicer/benchmarks/accuracy.bench.out
Documentation
The TypeScript SDK documentation is available at
gatewaycorporate.github.io/fp-devicer.
The Python package mirrors the same core architecture (core, libs,
benchmarks, and types) with Pythonic APIs.
Whitepaper
The whitepaper covers the theory, architecture, and design decisions behind FP-Devicer. You can read it here.
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
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 devicer_py-1.5.0.tar.gz.
File metadata
- Download URL: devicer_py-1.5.0.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14327a183deebe1cd817d501ae58c533504a974cb5f458f19b22c66430ee387e
|
|
| MD5 |
c7fdae64d552c1375adefb97fdd67d5d
|
|
| BLAKE2b-256 |
3416d5c447d70813f196062bf1f30e2ff39a7cd6e5ceeaea94dbfd73af8242f1
|
Provenance
The following attestation bundles were made for devicer_py-1.5.0.tar.gz:
Publisher:
workflow.yml on gatewaycorporate/fp-devicer-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devicer_py-1.5.0.tar.gz -
Subject digest:
14327a183deebe1cd817d501ae58c533504a974cb5f458f19b22c66430ee387e - Sigstore transparency entry: 1083137536
- Sigstore integration time:
-
Permalink:
gatewaycorporate/fp-devicer-python@91ff2989fe31f113670d154f92cc914d341220f2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gatewaycorporate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@91ff2989fe31f113670d154f92cc914d341220f2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file devicer_py-1.5.0-py3-none-any.whl.
File metadata
- Download URL: devicer_py-1.5.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a381e9ea416048cce07d838dcbebb69bff7c18c02123ee6740e50b41c914dedd
|
|
| MD5 |
66d478affbae2a7c9987047b31cbc607
|
|
| BLAKE2b-256 |
e00e95ec3d515167b868b0241676c159b0570c4af73a6c84a4c858db04ffaa21
|
Provenance
The following attestation bundles were made for devicer_py-1.5.0-py3-none-any.whl:
Publisher:
workflow.yml on gatewaycorporate/fp-devicer-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
devicer_py-1.5.0-py3-none-any.whl -
Subject digest:
a381e9ea416048cce07d838dcbebb69bff7c18c02123ee6740e50b41c914dedd - Sigstore transparency entry: 1083137571
- Sigstore integration time:
-
Permalink:
gatewaycorporate/fp-devicer-python@91ff2989fe31f113670d154f92cc914d341220f2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/gatewaycorporate
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@91ff2989fe31f113670d154f92cc914d341220f2 -
Trigger Event:
push
-
Statement type: