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