winterthur.collections.address ============================== .. py:module:: winterthur.collections.address Attributes ---------- .. autoapisummary:: winterthur.collections.address.HOST winterthur.collections.address.STREETS winterthur.collections.address.ADDRESSES Classes ------- .. autoapisummary:: winterthur.collections.address.StreetRow winterthur.collections.address.AddressCollection winterthur.collections.address.AddressSubsetCollection Module Contents --------------- .. py:class:: StreetRow Bases: :py:obj:`NamedTuple` .. py:attribute:: letter :type: str .. py:attribute:: street :type: str .. py:data:: HOST :value: 'https://stadt.winterthur.ch' .. py:data:: STREETS :value: 'https://stadt.winterthur.ch/_static/strassenverzeichnis/gswpl_strver_str.csv' .. py:data:: ADDRESSES :value: 'https://stadt.winterthur.ch/_static/strassenverzeichnis/gswpl_strver_adr.csv' .. py:class:: AddressCollection(session: sqlalchemy.orm.Session, **kwargs: Any) Bases: :py:obj:`onegov.core.collection.GenericCollection`\ [\ :py:obj:`onegov.winterthur.models.WinterthurAddress`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:property:: model_class :type: type[onegov.winterthur.models.WinterthurAddress] .. py:method:: streets() -> sqlalchemy.orm.Query[StreetRow] .. py:method:: last_updated() -> datetime.datetime | None .. py:method:: update_state() -> Literal['failed', 'ok'] .. py:method:: update(streets: str = STREETS, addresses: str = ADDRESSES) -> None .. py:method:: delete_existing() -> None .. py:method:: import_from_csv(streets: onegov.core.csv.CSVFile[onegov.core.csv.DefaultRow], addresses: onegov.core.csv.CSVFile[onegov.core.csv.DefaultRow]) -> None .. py:method:: load_urls(*urls: str) -> tuple[onegov.core.csv.CSVFile[onegov.core.csv.DefaultRow], Ellipsis] .. py:method:: load_url(url: str) -> onegov.core.csv.CSVFile[onegov.core.csv.DefaultRow] .. py:class:: AddressSubsetCollection(session: sqlalchemy.orm.Session, street: str) Bases: :py:obj:`onegov.core.collection.GenericCollection`\ [\ :py:obj:`onegov.winterthur.models.WinterthurAddress`\ ] Abstract base class for generic types. A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:: class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc. This class can then be used as follows:: def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default .. py:attribute:: street .. py:property:: model_class :type: type[onegov.winterthur.models.WinterthurAddress] .. py:method:: subset() -> sqlalchemy.orm.Query[onegov.winterthur.models.WinterthurAddress] .. py:method:: exists() -> bool