winterthur.collections.address

Attributes

HOST

STREETS

ADDRESSES

Classes

StreetRow

AddressCollection

Abstract base class for generic types.

AddressSubsetCollection

Abstract base class for generic types.

Module Contents

class winterthur.collections.address.StreetRow[source]

Bases: NamedTuple

letter: str[source]
street: str[source]
winterthur.collections.address.HOST = 'https://stadt.winterthur.ch'[source]
winterthur.collections.address.STREETS[source]
winterthur.collections.address.ADDRESSES[source]
class winterthur.collections.address.AddressCollection(session: sqlalchemy.orm.Session, **kwargs: Any)[source]

Bases: onegov.core.collection.GenericCollection[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
property model_class: type[onegov.winterthur.models.WinterthurAddress][source]
streets() Query[StreetRow][source]
last_updated() datetime | None[source]
update_state() Literal['failed', 'ok'][source]
update(streets: str = STREETS, addresses: str = ADDRESSES) None[source]
delete_existing() None[source]
import_from_csv(streets: CSVFile[DefaultRow], addresses: CSVFile[DefaultRow]) None[source]
load_urls(*urls: str) tuple[CSVFile[DefaultRow], Ellipsis][source]
load_url(url: str) CSVFile[DefaultRow][source]
class winterthur.collections.address.AddressSubsetCollection(session: sqlalchemy.orm.Session, street: str)[source]

Bases: onegov.core.collection.GenericCollection[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
property model_class: type[onegov.winterthur.models.WinterthurAddress][source]
subset() Query[WinterthurAddress][source]
exists() bool[source]