org.horw_laws

Snapshot and import Horw’s law collection into its existing directory.

Fetch: venv/bin/python -m onegov.org.horw_laws /tmp/horw-laws Import: venv/bin/onegov-org import-horw-laws /tmp/horw-laws.zip

Attributes

SOURCE

DIRECTORY

MONTHS

CATEGORIES

parser

Functions

source_url(→ str)

parse_date(→ str)

category(→ str)

fetch(→ bytes)

parse_detail(→ dict[str, Any])

snapshot_record(→ dict[str, Any])

snapshot(→ None)

read_manifest(→ tuple[list[dict[str, Any]], ...)

read_document(→ bytes)

import_records(→ dict[str, int])

Module Contents

org.horw_laws.SOURCE: str = 'https://www.horw.ch'[source]
org.horw_laws.DIRECTORY: str = 'systematische-rechtssammlung'[source]
org.horw_laws.MONTHS: tuple[str, ...] = ('Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober',...[source]
org.horw_laws.CATEGORIES: tuple[str, ...] = ('01 Gemeindeordnung', '02 Behörden', '03 Gemeindeverwaltung', '04 Personalwesen', '05 Bildung -...[source]
org.horw_laws.source_url(path: str) → str[source]
org.horw_laws.parse_date(value: str) → str[source]
org.horw_laws.category(number: str) → str[source]
org.horw_laws.fetch(url: str, path: pathlib.Path) → bytes[source]
org.horw_laws.parse_detail(content: bytes) → dict[str, Any][source]
org.horw_laws.snapshot_record(row: dict[str, str], path: pathlib.Path) → dict[str, Any][source]
org.horw_laws.snapshot(path: pathlib.Path) → None[source]
org.horw_laws.read_manifest(archive: zipfile.ZipFile) → tuple[list[dict[str, Any]], pathlib.PurePosixPath][source]
org.horw_laws.read_document(archive: zipfile.ZipFile, root: pathlib.PurePosixPath, document: dict[str, Any]) → bytes[source]
org.horw_laws.import_records(session: sqlalchemy.orm.Session, archive: zipfile.ZipFile) → dict[str, int][source]
org.horw_laws.parser: argparse.ArgumentParser[source]