privacy-policy

API Reference

This project currently exposes a command-line interface (CLI) rather than a stable importable class-based API.
Use the CLI to discover, extract, and evaluate privacy policies, and consume the JSON it prints to stdout.

πŸ“‹ Table of Contents

Command

# Using uv
uv run python src/main.py [OPTIONS]

# Or module form
python -m src.main [OPTIONS]

Required: --url (site URL for auto-discovery or a direct privacy policy URL)

Options

Output Schemas

The CLI prints JSON to stdout.

summary

{
"status": "ok",
"url": "https://example.com",
"resolved_url": "https://example.com/privacy",
"model": "gpt-4o",
"chunks": 12,
"valid_chunks": 11,
"overall_score": 82.5,
"confidence": 0.9,
"top_strengths": [["user_rights_and_redress", 8.7], ["security_and_breach", 8.2], ["transparency_and_notice", 7.9]],
"top_risks": [["cross_border_transfers", 5.1], ["retention_and_deletion", 6.0], ["secondary_use_and_limits", 6.2]],
"red_flags_count": 2
}

detailed

Adds:

full

Adds:

Categories & Weights

Each category is scored 0–10 per chunk by the model; scores are averaged and combined with the weights below to form the 0–100 overall score.

Environment Variables

Exit Codes

Examples

Analyze a homepage (auto-discovery):

uv run python src/main.py --url https://example.com

Analyze a known policy URL directly:

uv run python src/main.py --url https://example.com/privacy-policy --no-discover --report detailed

Force Selenium for a client-rendered page:

uv run python src/main.py --url https://example.com/privacy --fetch selenium

Tune chunking for very long policies:

uv run python src/main.py --url https://example.com --chunk-size 3000 --chunk-overlap 300 --max-chunks 25