Metadata-Version: 2.4
Name: gdpr-site-auditor
Version: 0.1.0
Summary: Check websites for GDPR/RGPD compliance - privacy, cookies, tracking, forms
Author-email: Leviantan07 <laurenceau@hotmail.com>
License: MIT
Project-URL: Homepage, https://github.com/Leviantan07/gdpr-site-auditor
Project-URL: Repository, https://github.com/Leviantan07/gdpr-site-auditor
Project-URL: Issues, https://github.com/Leviantan07/gdpr-site-auditor/issues
Project-URL: Documentation, https://github.com/Leviantan07/gdpr-site-auditor#readme
Keywords: gdpr,rgpd,privacy,compliance,audit,cookies,dpo
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24.0
Provides-Extra: cli
Requires-Dist: click>=8.0; extra == "cli"
Dynamic: license-file

# 🔒 GDPR Site Auditor

[![PyPI version](https://badge.fury.io/py/gdpr-site-auditor.svg)](https://pypi.org/project/gdpr-site-auditor/)
[![Python](https://img.shields.io/pypi/pyversions/gdpr-site-auditor.svg)](https://pypi.org/project/gdpr-site-auditor/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://pepy.tech/badge/gdpr-site-auditor)](https://pepy.tech/project/gdpr-site-auditor)

**Check websites for GDPR/RGPD compliance in seconds.** Detects privacy issues, cookie problems, missing consent mechanisms, and tracking scripts.

## 🎯 What it checks

| Check | Description |
|-------|-------------|
| 🍪 **Cookies** | Tracking cookies, consent banners, cookie policies |
| 📋 **Privacy Policy** | Presence, required elements (controller, rights, retention) |
| 📝 **Forms** | Consent checkboxes, privacy links, purpose statements |
| 📊 **Tracking** | Google Analytics, Facebook Pixel, Hotjar, etc. |
| 🛡️ **Security Headers** | HSTS, CSP, X-Frame-Options, Permissions-Policy |

## 🚀 Quick Start

```bash
# Install
pip install gdpr-site-auditor

# Audit a website
gdpr-audit https://example.com

# JSON output
gdpr-audit https://example.com --json
```

## 📦 Usage as Library

```python
import asyncio
from gdpr_auditor import SiteAuditor
from gdpr_auditor.checks import check_security_headers
from gdpr_auditor.checks.cookies import check_cookies
from gdpr_auditor.checks.privacy import check_privacy_policy
from gdpr_auditor.checks.tracking import check_tracking
from gdpr_auditor.checks.forms import check_forms

async def main():
    auditor = SiteAuditor()
    auditor.register_check(check_security_headers)
    auditor.register_check(check_cookies)
    auditor.register_check(check_privacy_policy)
    auditor.register_check(check_tracking)
    auditor.register_check(check_forms)

    result = await auditor.audit("https://example.com")

    print(f"Score: {result.score}/100")
    print(f"Critical: {result.critical_count}")
    print(f"Warnings: {result.warning_count}")

    for issue in result.issues:
        print(f"[{issue.severity.value}] {issue.title}")
        print(f"  → {issue.recommendation}")

asyncio.run(main())
```

## 📊 Example Output

```
============================================================
  GDPR/RGPD Site Audit Report
  URL: https://example.com
============================================================

  Score: 72/100 (⚠️  NEEDS IMPROVEMENT)
  Critical: 2 | Warnings: 3

  ISSUES FOUND:
  --------------------------------------------------
  🔴 [CRITICAL] Tracking scripts detected
     Found tracking: Google Analytics. These require explicit user consent under GDPR.
     → Ensure tracking scripts are only loaded AFTER user gives explicit consent.

  🔴 [CRITICAL] Form collects data without consent checkbox
     Form 1 collects email but has no consent mechanism.
     → Add a mandatory consent checkbox before submit.

  🟡 [WARNING] No cookie consent mechanism found
     The site sets cookies but no cookie consent banner was detected.
     → Implement a cookie consent banner.

  ✅ PASSED CHECKS (5):
     • privacy_policy_link
     • security_header_strict-transport-security
     • no_forms_detected
     • no_tracking_cookies_before_consent

============================================================
```

## 🤝 Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

### Good first issues

- Add more tracking script detection patterns
- Add i18n for more languages (German, Spanish, Italian)
- Add checks for data export/deletion requests
- Add accessibility checks (a11y)
- Improve form detection accuracy

## 📜 License

MIT License - see [LICENSE](LICENSE)

## 🔗 Related

- [GDPR Official Text](https://gdpr.eu/)
- [RGPD en français](https://www.cnil.fr/fr/rgpd-passer-a-laction)
- [OpenSSF Criticality Score](https://github.com/ossf/criticality_score)
