swissvotes.external_resources.posters

Classes

Posters

MfgPosters

BsPosters

Plakatsammlung Basel

SaPosters

Sozial Archiv Zürich

Module Contents

class swissvotes.external_resources.posters.Posters[source]
yea_attribute: str[source]
nay_attribute: str[source]
yea_img_attribute: str[source]
nay_img_attribute: str[source]
headers: dict[str, str][source]
abstract meta_data_url(url: str) str[source]
abstract get_object_id(url: str) str[source]
parse_xml(response: requests.Response) str[source]
_fetch(bfs_number: decimal.Decimal, poster_urls: str | None, image_urls: dict[str, Any]) tuple[dict[str, str], int, int, int, set[tuple[decimal.Decimal, str]]][source]
fetch(session: sqlalchemy.orm.Session) tuple[int, int, int, set[tuple[decimal.Decimal, str]]][source]

Returns a dictionary with changed image urls as compared to the image_urls dictionary and if changed and how many added/updated.

class swissvotes.external_resources.posters.MfgPosters(api_key: str)[source]

Bases: Posters

yea_attribute = 'posters_mfg_yea'[source]
nay_attribute = 'posters_mfg_nay'[source]
yea_img_attribute = 'posters_mfg_yea_imgs'[source]
nay_img_attribute = 'posters_mfg_nay_imgs'[source]
headers[source]
base = 'https://www.emuseum.ch/objects/'[source]
meta_data_url(url: str) str[source]
get_object_id(url: str) str[source]
class swissvotes.external_resources.posters.BsPosters(api_key: str)[source]

Bases: Posters

Plakatsammlung Basel

yea_attribute = 'posters_bs_yea'[source]
nay_attribute = 'posters_bs_nay'[source]
yea_img_attribute = 'posters_bs_yea_imgs'[source]
nay_img_attribute = 'posters_bs_nay_imgs'[source]
api_key[source]
headers[source]
base = 'https://www.recherche-plakatsammlungbasel.ch/objects/'[source]
meta_data_url(url: str) str[source]
get_object_id(url: str) str[source]
class swissvotes.external_resources.posters.SaPosters[source]

Bases: Posters

Sozial Archiv Zürich

yea_attribute = 'posters_sa_yea'[source]
nay_attribute = 'posters_sa_nay'[source]
yea_img_attribute = 'posters_sa_yea_imgs'[source]
nay_img_attribute = 'posters_sa_nay_imgs'[source]
headers[source]
base = 'https://www.bild-video-ton.ch/bestand/objekt/'[source]
meta_data_url(url: str) str[source]
get_object_id(url: str) str[source]