personroles.resources package

Submodules

personroles.resources.constants module

Collection of constants like GERMAN_PARTIES, PEERTITLES, …

personroles.resources.helpers module

Helper functions: exceptions, print style, Party, …

class personroles.resources.helpers.AttrDisplay[source]

Bases: object

Mark Lutz, Programming Python Provides an inheritable display overload method that shows instances with their class names and a name=value pair for each attribute stored on the instance itself (but not attrs inherited from its classes). Can be mixed into any class, and will work on any instance.

gather_attrs() → list[source]

Check if attributes have content and add them to a list called attrs.

exception personroles.resources.helpers.NotGermanParty[source]

Bases: Exception

Only German parties, this will most likely not change.

exception personroles.resources.helpers.NotInRange[source]

Bases: Exception

For state NRW only terms 14 to currently term 17 are accepted.

class personroles.resources.helpers.Party(party_name: str, party_entry: str = 'unknown', party_exit: str = 'unknown')[source]

Bases: personroles.resources.helpers._Party_default, personroles.resources.helpers._Party_base, personroles.resources.helpers.AttrDisplay

Collect party name and entry/exit data.

class personroles.resources.helpers.Session(state: str, term: str, date: str, protocol_nr: str, page_from: str = 'unknown', page_to: str = 'unknown', expletive: str = 'unknown', kind: str = 'unknown', result: str = 'unknown', classification: str = 'unknown', tags: List[str] = <factory>, region: str = 'unknown', speakers: List[str] = <factory>)[source]

Bases: personroles.resources.helpers._Session_default, personroles.resources.helpers._Session_base, personroles.resources.helpers.AttrDisplay

A session’s details.

exception personroles.resources.helpers.TooManyFirstNames(message)[source]

Bases: Exception

Currently only one first name and two middle names are supported. Example: Tom H. Paul last_name

personroles.resources.mop_tinyDB module

Module contents

Some constants declarations, print styling, exceptions, and another container.

Module resources provides constants (like GERMAN_PARTIES, PEERTITLES, …) and helper functions like exceptions and data containers like Party that are needed for personroles.

Constants:
GERMAN_PARTIES PEERTITLES PEER_PREPOSITIONS
Helper functions:
exceptions:
NotInRange (legislature of state) NotGermanParty TooManyFirstNames (in Germany not more than three)
print style:
AttrDisplay
Party:
_Party_base:
party_name
_Party_default:
party_entry party_exit

planned: Speech:

_Speech_base:
speech_key
_Speech_default:
speech_content