Maintenance

Site is under maintenance — quizzes are still available.

Go to quizzes
Reference library

Automation & scripting

CLI tools, scheduled jobs, filesystem tasks, and glue scripts that save time.

1 match
Automation & scripting easy

How to Monitor Domain Expiration Dates in Python

A Python script that checks domain expiration dates using the python-whois library and warns when a domain is expiring soon.

whois domain automation
Python
import whois
from datetime import datetime, timedelta
import time

def check_domain_expiry(domain_name):
    """Check when a domain expires and warn if soon."""
    try:
        w = whois.whois(domain_name)
        expiry = w.expiration_date
        # Handle list or single date
        if isinstance(expiry, list):
   …
2 0 Open

Browse by section

Each section groups closely related Python snippets.

Automation & scripting — Python code examples

What you will find here

This page collects automation & scripting snippets — short, copy-ready Python you can paste into our free online IDE and run without installing anything. Each sample includes a plain-English explanation and the full source code.

Samples vs tutorials and challenges

Samples are quick reference — one concept per page. For step-by-step teaching, use our Python tutorials. To test yourself, try quizzes or coding challenges. Clean up style with the Python formatter.