people.cli
Attributes
Functions
|
Deletes all people. |
Strips leading/trailing whitespace from first_name, last_name, |
|
|
Exports all people to an excel file. |
|
Imports people from an excel file. |
|
|
|
|
|
Read all rows from an .xls or .xlsx file as tuples of cell values. |
|
|
|
|
|
Find existing person by email or name and update, or create new. |
|
Imports people from a Horw municipality Excel export. |
|
Module Contents
- people.cli.clear(dry_run: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]
Deletes all people.
Does not support agencies and memberships at the moment.
Example:
onegov-people –select ‘/org/govikon’ clear
- people.cli.strip_whitespace_from_names(dry_run: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]
Strips leading/trailing whitespace from first_name, last_name, and function of all people.
Example:
onegov-people –select /onegov_org/* strip-whitespace-from-names onegov-people –select /onegov_town6/* strip-whitespace-from-names
- people.cli.export_xlsx(filename: str) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]
Exports all people to an excel file.
Does not support agencies and memberships at the moment.
Example:
onegov-people –select ‘/onegov_org/govikon’ export people.xlsx
- people.cli.import_xlsx(file: IO[bytes]) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]
Imports people from an excel file.
Does not support agencies and memberships at the moment.
Example:
onegov-people –select ‘/onegov_org/govikon’ import people.xlsx
- people.cli._HORW_PERSONEN_HEADER = ('Name', 'Vorname', 'E-Mail', 'Internet', 'Funktion', 'Strasse', 'Nr.', 'PLZ', 'Ort', 'Telefon...[source]
- people.cli._HORW_BEHOERDEN_HEADER = ('Behörde', 'Strasse', 'Nr.', 'Postfach', 'PLZ', 'Ort', 'Telefon', 'E-Mail', 'URL / Homepage',...[source]
- people.cli._read_excel_rows(path: str) list[tuple[object, Ellipsis]][source]
Read all rows from an .xls or .xlsx file as tuples of cell values.
- people.cli._upsert_horw_person(people: onegov.people.collections.PersonCollection, first_name: str, last_name: str, extra: dict[str, object]) None[source]
Find existing person by email or name and update, or create new.
- people.cli.import_horw(file: str, dry_run: bool) collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]
Imports people from a Horw municipality Excel export.
Detects the file format automatically from the header row. Supports both the Personen export (one person per row) and the Behörden export (one membership per row, people deduplicated by email then name).
Example:
onegov-people –select /onegov_town6/horw import-horw export.xls