๐Ÿฅ site-health

Fast website health checks for Python.
Zero dependencies.

pip install site-health
๐Ÿ Python 3.8+ ๐Ÿ“ฆ Zero Dependencies โšก Fast ๐Ÿ”’ MIT License

What It Checks

SSL Certificate

Validates certificate, checks expiration date, identifies issuer, and verifies TLS protocol version.

Security Headers

Checks 7 critical headers: HSTS, CSP, X-Frame-Options, X-Content-Type-Options, and more.

Performance

Measures response time and TTFB. Rates performance as fast, moderate, or slow.

DNS Resolution

Verifies DNS resolution and retrieves both IPv4 and IPv6 addresses.

Overall Grade

Calculates a weighted score (0-100) and letter grade (A+ to F) based on all checks.

CI/CD Ready

Exit codes for automation. Use --ci flag to fail builds on unhealthy sites.

Quick Start

# Check a website site-health example.com # Check multiple sites site-health google.com github.com stripe.com # JSON output (for scripts) site-health example.com --json # CI mode (exit 1 if unhealthy) site-health example.com --ci # SSL-only check site-health example.com --ssl-only # Quick ping site-health example.com --ping

Python API

from site_health import check, ping, check_many # Full health check result = check('https://example.com') print(result.grade) # 'A+', 'A', 'B', 'C', 'D', or 'F' print(result.healthy) # True or False print(result.score) # 0-100 # Access detailed results print(result.ssl.valid) # True/False print(result.ssl.days_until_expiry) # Days until cert expires print(result.headers.score) # Security headers score print(result.headers.missing) # List of missing headers # Quick ping is_up = ping('example.com') # True or False # Check multiple sites results = check_many(['google.com', 'github.com']) for r in results: print(f'{r.url}: {r.grade}')

JSON Output

{ "url": "https://example.com", "healthy": true, "grade": "B", "score": 78, "ssl": { "valid": true, "issuer": "DigiCert Inc", "days_until_expiry": 45 }, "headers": { "score": 60, "present": ["X-Content-Type-Options", "X-Frame-Options"], "missing": ["Content-Security-Policy", "Strict-Transport-Security"] }, "performance": { "response_time_ms": 156, "rating": "fast" } }

๐Ÿ’ก Need 24/7 Monitoring with Alerts?

Get instant notifications when your sites go down, SSL expires, or security headers change.

Start Monitoring โ†’