privacy-policy

User Guide

This guide explains how to install, run, and interpret results from Privacy Policy Analyzer. The tool is currently CLI-first (no stable class-based API).

πŸ“‹ Table of Contents

πŸš€ Installation

Prerequisites

git clone https://github.com/HappyHackingSpace/privacy-policy.git
cd privacy-policy
uv sync
# optional: activate .venv if you prefer a shell-activated workflow
# macOS/Linux: source .venv/bin/activate
# Windows: .venv\Scripts\activate

Using Poetry

git clone https://github.com/HappyHackingSpace/privacy-policy.git
cd privacy-policy
poetry install
# run commands with: poetry run <command>

Using pip

git clone https://github.com/HappyHackingSpace/privacy-policy.git
cd privacy-policy
python -m venv .venv
# macOS/Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
pip install -e .

Create a .env file if desired:

Verify that your API key is visible to the process:

python -c "import os; print('API key set:', bool(os.getenv('OPENAI_API_KEY')))"

πŸ”§ Basic Usage

Run the CLI with a site URL (auto-discovery will try to resolve a likely privacy policy page):

# uv
uv run python src/main.py --url https://example.com
# or module form
python -m src.main --url https://example.com

Analyze a known policy URL directly (skip auto-discovery):

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

Choose a fetch method:

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

Control output detail:

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

βš™οΈ Configuration

Environment Variables

You can configure the model and environment via variables or flags.

CLI flags that control analysis:

πŸ” Analysis Methods

πŸ“Š Understanding Results

The CLI prints JSON to stdout.

Common fields:

Dimensions (what they mean)

Each dimension is scored 0–10; weights are applied to compute the overall score:

πŸš€ Advanced Features

Note: Caching, batch processing, CSV/HTML exports, and a stable importable Python API are not part of the current CLI release. See the roadmap in the contributing guide.

πŸ”§ Troubleshooting

πŸ“š Examples

Analyze a homepage with default settings:

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

Analyze a known policy URL with detailed output:

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

Force Selenium for a client-rendered policy:

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

πŸ†˜ Getting Help


Happy analyzing! πŸ”βœ¨