Python SDK
A Python SDK to easily interact with the Oh Dear API from your Python applications.
The Python SDK provides a convenient way to interact with the Oh Dear API from Python applications. Built and maintained by Owen Voke, it offers full access to Oh Dear's monitoring capabilities.
Installation #
pip install ohdear-sdk
Features #
The SDK supports all major Oh Dear API operations:
- Authentication: Validate credentials and retrieve account information
- Site Management: List and retrieve monitored websites
- Broken Links: Detect broken links across monitored sites
- Certificate Health: Check SSL certificate status
- Cron Checks: Monitor scheduled task execution
- Mixed Content: Identify mixed content issues
- Domain Monitoring: Track domain registration and expiry
- Check Control: Enable or disable specific monitoring checks
Usage #
from ohdear import OhDear ohdear = OhDear(api_token="your-api-token") # Get all sites sites = ohdear.sites.all() # Get a specific site site = ohdear.sites.show(site_id) # Get broken links broken_links = ohdear.broken_links.show(site_id) # Get certificate health cert = ohdear.certificate_health.show(site_id)
Testing #
The SDK uses hatch for testing:
hatch shell hatch run test
For more details, see the GitHub repository.