API reference

Classification

govdomains.Classifier([evidence, rules])

Classify offline.

govdomains.Rule(suffix[, country, scope, ...])

A hostname rule with explicit scope, provenance, and optional validity dates.

govdomains.Evidence(hostname, source[, ...])

One source observation about a hostname or a page on that hostname.

govdomains.Result(hostname, label, status, ...)

A classification with supporting evidence, rules, and its evaluation date.

govdomains.normalize_hostname(value)

Return an IDNA hostname from a bare name or HTTP(S) URL.

govdomains.load_rules()

Load the notebook-derived heuristic rules bundled with the package.

Bundled lists and snapshots

govdomains.bundled_sources()

Describe available snapshots without loading tables or accessing the network.

govdomains.load_bundled(*names)

Load selected offline lists; default to the latest shipped source snapshots.

govdomains.Snapshot(evidence, metadata)

Deduplicated source observations and their collection metadata.

Collection and imports

govdomains.sources.fetch_list(name, *[, session])

Explicitly fetch a current CISA or GSA list.

govdomains.sources.import_list(path, **kwargs)

Import a local CSV/TSV; caller must supply its source identifier.

govdomains.sources.parse_list(content, *, source)

Parse a saved list.

govdomains.crawl.CommonCrawl(index, *[, ...])

Serial, retrying collection.

govdomains.crawl.import_crawl_csv(path, *, ...)

Stream a notebook-exported CDX CSV into unique-host observations.

govdomains.crawl.patterns_for(country)

Return notebook-derived discovery suffixes for an exact country label.