people.cli

Attributes

cli

EXPORT_FIELDS

p2

p3

p4

p1

p6

p5

re_postal_code_city_ch

re_postal_code_city_de

Functions

clear(→ Callable[[CoreRequest, Framework], None])

Deletes all people.

export_xlsx(→ Callable[[CoreRequest, Framework], None])

Exports all people to an excel file.

import_xlsx(→ Callable[[CoreRequest, Framework], None])

Imports people from an excel file.

parse_and_split_address_field(→ tuple[str, str, str, str])

Parsing the address field to split into location address and code/city

migrate_people_address_field(→ Callable[[CoreRequest, ...)

Migrates onegov_agency people address field.

onegov_migrate_people_address_field(...)

Migrates people address field everywhere in onegov.

parse_agency_portrait_field_for_address(→ tuple[str, ...)

Parsing the portrait field of agencies and extract address and

extract_address_from_portrait_field(...)

Extracts address from onegov_agency agency portrait field.

Module Contents

people.cli.cli[source]
people.cli.clear(dry_run: bool) Callable[[CoreRequest, Framework], None][source]

Deletes all people.

Does not support agencies and memberships at the moment.

Example:

onegov-people –select ‘/org/govikon’ clear

people.cli.EXPORT_FIELDS[source]
people.cli.export_xlsx(filename: str) Callable[[CoreRequest, Framework], None][source]

Exports all people to an excel file.

Does not support agencies and memberships at the moment.

Example:

onegov-people –select ‘/org/govikon’ export people.xlsx

people.cli.import_xlsx(file: IO[bytes]) Callable[[CoreRequest, Framework], None][source]

Imports people from an excel file.

Does not support agencies and memberships at the moment.

Example:

onegov-people –select ‘/org/govikon’ import people.xlsx

people.cli.p2[source]
people.cli.p3[source]
people.cli.p4[source]
people.cli.p1[source]
people.cli.p6[source]
people.cli.p5[source]
people.cli.parse_and_split_address_field(address: str) tuple[str, str, str, str][source]

Parsing the address field to split into location address and code/city as well as postal address and code/city.

:param address:str :return: tuple: (location_address, location_code_city,

postal_address, postal_code_city)

people.cli.migrate_people_address_field(dry_run: bool) Callable[[CoreRequest, Framework], None][source]

Migrates onegov_agency people address field.

Migrate data from onegov_agency table ‘people’ column ‘address’ field to ‘location_address’, ‘location_code_city’, ‘postal_address’ and ‘postal_code_city’ fields.

Example:

onegov-people –select /onegov_agency/bs migrate-people-address-field

onegov-people –select /onegov_agency/bs migrate-people-address-field –dry-run

people.cli.onegov_migrate_people_address_field(dry_run: bool) Callable[[CoreRequest, Framework], None][source]

Migrates people address field everywhere in onegov.

Migrate data from ‘people’ column ‘address’ field to ‘location_address’, ‘location_code_city’, ‘postal_address’ and ‘postal_code_city’ fields.

Example:

onegov-people –select /onegov_town6/ebikon onegov-migrate-people-address-field

onegov-people –select /onegov_org/risch onegov-migrate-people-address-field –dry-run

people.cli.re_postal_code_city_ch[source]
people.cli.re_postal_code_city_de[source]
people.cli.parse_agency_portrait_field_for_address(portrait: str) tuple[str, str, str, str][source]

Parsing the portrait field of agencies and extract address and code/city as well as location address and city if present.

Parameters:

portrait – html str

Returns:

tuple: (location_addr, location_pcc ,postal_address,

postal_code_city)

people.cli.extract_address_from_portrait_field(dry_run: bool) Callable[[CoreRequest, Framework], None][source]

Extracts address from onegov_agency agency portrait field.

Extracts address, postal code and city from onegov_agency table ‘agencies’ column ‘portrait’.

Example:

onegov-people –select /onegov_agency/bs

extract-address-from-portrait-field

onegov-people –select /onegov_agency/bs

extract-address-from-portrait-field –dry-run