htmldate
Fast and robust extraction of original and updated publication dates from URLs and web pages.
What it is and what it does
Htmldate is a Python library and command-line tool for finding publication and update dates on web pages. It works by examining HTML markup (meta tags, Open Graph attributes, structural elements like `time` and `abbr`), then falling back to heuristic text analysis when metadata is absent. The package includes both a fast mode for quick extraction and an extensive mode that collects all candidate dates and uses a disambiguation algorithm to select the most likely one.
The library handles flexible input (URLs, HTML files, or parsed trees) and outputs dates in customizable formats, defaulting to ISO 8601. It is multilingual and has been deployed in production on millions of documents. The package depends on lxml for parsing, dateparser for date normalization, charset_normalizer for encoding detection, python-dateutil for date manipulation, and urllib3 for HTTP requests.
Use it for:
- Automated metadata extraction for web corpora and text databases in research or archival projects.
- Enriching web scraping pipelines with reliable publication dates when server headers are missing or unreliable.
- Batch processing of archived or crawled web pages to extract and standardize publication timestamps.
- Building content aggregation systems that need to sort or filter articles by publication date.
- Detecting content updates by comparing original and updated publication dates on news or blog sites.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extracts original and updated publication dates from web pages by parsing HTML markup, metadata, and text content, with both Python API and command-line interfaces.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is production-tested on millions of documents and ranks in the top 5000 PyPI packages by download volume. Install it if you need reliable date extraction from web pages; the fast mode offers good speed and the extensive mode provides high recall when accuracy matters most.
Install
htmldate on PyPI
pip
pip install htmldateuv
uv add htmldatepoetry
poetry add htmldateInstalling htmldate
Before you install
Low friction installation with a pure-Python wheel and five runtime dependencies. Actively maintained as of 2026-07-31 with recent release activity.
License in practice
Distributed under Apache 2.0, a permissive license allowing commercial and private use with minimal restrictions; versions prior to 1.8.0 used GPLv3+.
Quickstart
pip install htmldate
from htmldate import find_date
date = find_date('http://blog.python.org/2016/12/python-360-is-now-available.html')
print(date) # '2016-12-23'
Requires Python 3.10 or later; earlier versions (1.8.1 for Python 3.6–3.7, 1.9.x for 3.8–3.9) are available if needed.
Verify before relying
- Whether the package handles redirects, authentication, or rate-limiting when fetching URLs.
- Performance characteristics on pages with malformed or ambiguous date markup.
- Whether batch processing supports concurrent requests or is sequential only.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — charset_normalizer, dateparser, lxml, python-dateutil, urllib3 |
| Maintenance | actively maintained — 74 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,949,222/month — #1,210 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: htmldate-1.10.0-py3-none-any.whl
Keywords: datetime, date-parser, entity-extraction, html-extraction, html-parsing, metadata-extraction, webarchives, web-scraping
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
date-guesserExtracts publication dates from web pages by…
permissive · top 15,000 on PyPI
trafilaturaTrafilatura extracts main text, metadata, and…
permissive · top 5,000 on PyPI
datefinderDatefinder extracts date and time expressions…
permissive · top 5,000 on PyPI
dateparserParses dates from text in multiple languages…
permissive · top 1,000 on PyPI
readable-contentExtracts the main article content from web…
permissive · top 15,000 on PyPI
nr-dateA pure-Python date parser using regex patterns…
permissive · top 15,000 on PyPI
prefixdateParses date strings with partial precision…
permissive · top 5,000 on PyPI
requests-htmlParses and scrapes HTML from web pages using a…
permissive · top 15,000 on PyPI
mkdocs-rss-pluginGenerates RSS 2.0 and JSON Feed 1.1 feeds for…
permissive · top 15,000 on PyPI