pynami.schemas package

Submodules

pynami.schemas.activity module

Schemas for activities

class Activity(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class for activities directly obtained by their id.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class ActivitySchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Activity class

__model__

alias of Activity

aktivBis = None

End date

Type:datetime
aktivVon = None

Start date

Type:datetime
beitragsArtId = None

Fee type

Type:int
caeaGroup = None

Access rights for the group

Type:str
caeaGroupForGf = None

Access rights for sub group

Type:str
caeaGroupForGfId = None

Access right id

Type:int
caeaGroupId = None

Access right id

Type:int
gruppierung = None

Group associated wiht the activity

Type:str
gruppierungId = None

Group id

Type:int
id = None

Id

Type:int
taetigkeit = None

Kind of activity

Type:str
taetigkeitId = None

Activity id

Type:int
untergliederung = None

Tier or group association

Type:str
untergliederungId = None

tier or sub group id

Type:int
class SearchActivity(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Main class for activities wich come up as a search result.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

get_activity(nami, mglId)[source]

Create a real Activity form the search result by getting the corresponding data set through the activity id.

Parameters:
  • nami (NaMi) – Main NaMi class
  • mglId (int) – Member id (not DPSG Mitgliedsnummer)
Returns:

The activity object corresponding to this search result.

Return type:

Activity

class SearchActivitySchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the SearchActivity class

__model__

alias of SearchActivity

entries_aktivBis = None

End date

Type:datetime
entries_aktivVon = None

Start date

Type:datetime
entries_anlagedatum = None

Creation date

Type:datetime
entries_beitragsArt = None

Fee type

Type:str
entries_caeaGroup = None

Access rights for the group

Type:str
entries_caeaGroupForGf = None

Access rights for sub group

Type:str
entries_gruppierung = None

Group associated wiht the activity

Type:str
entries_mitglied = None

Member

Type:str
entries_taetigkeit = None

Kind of activity

Type:str
entries_untergliederung = None

Tier or group association

Type:str

pynami.schemas.base module

This module contains some base classes

exception AccessError[source]

Bases: AttributeError

class BaseModel(**kwargs)[source]

Bases: object

Base class for all the main classes.

It stores all data entries as instance attributes.

__getstate__()[source]

Enable saving data through pickling

Returns:Returns the __dict__ attribute of the class.
Return type:dict
__setattr__(name, value)[source]

Set certain fields to read-only

Parameters:
  • name (str) – Attribute name.
  • value – New value.
Raises:

AccessError – In case of invalid write access.

Returns:

None

__setstate__(state)[source]

Enable loading data with the pickle module

Parameters:state (dict) – Loaded data.
Returns:None
_field_blacklist = []

Attribute names which are to be skipped while preparing tabulated output

Type:list
_tabkeys = []

Default attributes names for tabulating and data export. This attribute is inherited and adapted to all Schema classes from BaseModel.

Type:list of str
table_view(field_blacklist=None)[source]

Prepare nicely formatted output

Parameters:field_blacklist (list of str, optional) – List of attributes to be skipped
Returns:All data entries which are not in the blacklist
Return type:dict
tabulate(elements=None)[source]

Prepare ordered tabulated output

Parameters:elements (list of str, optional) – List of keys which shall be included in the table
Returns:Specified data entries
Return type:OrderedDict
class BaseSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

Base class for all Schemas in this module

It handles the formatting of dates so that the fields in the derived classes can be standard DateTime field.

Note

This class can not be used on its own but only as a derived class.

class Meta[source]

Bases: object

This Base Meta class defines the default date and time format.

dateformat = '%Y-%m-%d %H:%M:%S'

Default NaMi date format. Note that in most cases the time part is only zeroes. However it can happen that the incoming value has time information as well.

Type:str
datetimeformat = '%Y-%m-%d %H:%M:%S'

Default NaMi datetime format

Type:str
__model__

class: Main class which this Schema is modelling. Each derived class must define this attribute.

alias of BaseModel

_declared_fields = {}
_hooks = {('post_load', False): ['make_object'], ('pre_load', False): ['correctEmptySTrings']}
correctEmptySTrings(data, **kwargs)[source]

Replace empty strings with None

This method loops over all fields of the derived Schema class and where it finds a DateTime field and an empty string in the data dict it replaces this value with None.

To achieve that this is applied before loading this method is decorated with pre_load() decorator.

Parameters:data (dict) – Data dictionary which is about to be loaded
Returns:Adjusted data dictionary
Return type:dict
make_object(data, **kwargs)[source]

Create the object associated with this Schema by making use of the post_load() decorator.

Parameters:
  • data (dict) – Data dictionary containing all keywords and their values
  • **kwargs – Possible keyword arguments passed through to this method during the loading procedure.
Returns:

Main class correspoding to this Schema

Return type:

class

class BaseSearchModel(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Base class for all classes that are loaded from a BaseSearchSchema

_tabkeys = ['id', 'descriptor']
type

NaMi class without the hierarchy

Type:str
class BaseSearchSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Base class for all schemas that describe search results.

All search results share the same three attributes.

__model__

alias of BaseSearchModel

_declared_fields = {'descriptor': <fields.String(dump_default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, load_default=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>, 'id': <fields.Raw(dump_default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, load_default=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.'})>, 'representedClass': <fields.String(dump_default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, load_default=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>}
_hooks = {('post_load', False): ['make_object'], ('pre_load', False): ['correctEmptySTrings']}
descriptor = None

Object description. In some cases the same as representedClass.

Type:str
id = None

Internal id of the object This is an integer in most cases.

Type:int ore str
representedClass = None

NaMi class structure

Type:str

pynami.schemas.cogc module

This module contains classes to handle stuff with the certificates of good conduct.

class Bescheinigung(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Base data class for a certificate about the inspection of a certificate of goos conduct.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

download_fz(nami, **kwargs)[source]

Open the certificate as a PDF file

Parameters:
Returns:

None

class BescheinigungSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Bescheinigung class

__model__

alias of Bescheinigung

autor = None

Person who did the inspection

Type:str
datumEinsicht = None

Inspection date. May be empty.

Type:datetime
download = None

Relative download URL

Type:str
empfaenger = None

Receiver

Type:str
erstelltAm = None

Entry creation date

Type:datetime
fzDatum = None

Date of the certificate of good conduct

Type:datetime
fzNummer = None

Number of the certificate of good conduct

Type:str
get_download_url(data, **kwargs)[source]

Extract the HTML enclosed URL string from the pdf download field

Parameters:data (dict) – Data dictionary
Returns:The updated data dictionary
Return type:dict
id = None

Id of this certificate

Type:int
class SearchBescheinigung(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Base data class for a certificate about the inspection of a certificate of goos conduct that came up as a search result.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

download_fz(nami, **kwargs)[source]

Open the certificate as a PDF file

Parameters:
Returns:

None

get_bescheinigung(nami)[source]

Create a real Bescheinigung form the search result by getting the corresponding data set through the certificate id.

Parameters:nami (NaMi) – Main NaMi class
Returns:The certificate object corresponding to this search result.
Return type:Bescheinigung
class SearchBescheinigungSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the SearchBescheinigung class

__model__

alias of SearchBescheinigung

entries_autor = None

Person who did the inspection

Type:str
entries_datumEinsicht = None

Inspection date. May be empty.

Type:datetime
entries_empfGebDatum = None

Birth date

Type:datetime
entries_empfNachname = None

Surname

Type:str
entries_empfVorname = None

First name

Type:str
entries_empfaenger = None

Receiver

Type:str
entries_erstelltAm = None

Entry creation date

Type:datetime
entries_fzDatum = None

Date of the certificate of good conduct

Type:datetime
entries_fzNummer = None

Number of the certificate of good conduct

Type:str

pynami.schemas.dashboard module

Schemas for dashboard functionalities

class Notification(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Main class for notification like tier changes of a mitglied.

In the NaMi the notifications are displayed in the dashboard.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class NotificationSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the Notification class

__model__

alias of Notification

entries_actor = None

The person who started the event

Type:str
entries_actorId = None

Id of the person who started the event

Type:int
entries_changedFields = None

Which fields have been changed. This may be empty.

Type:str
entries_completeChanges = None

More details about the changes. This may be empty.

Type:str
entries_entryDate = None

Date of the event

Type:datetime
entries_id = None

Id of the event

Type:int
entries_newObject = None

New object

Type:str
entries_objectClass = None

NaMi class

Type:str
entries_objectId = None

Object id

Type:int
entries_operation = None

The nature of the change

Type:str
entries_originalObject = None

Old object. This may be empty

Type:str
class StatCatSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the StatCategory class.

This only contains the name of the tier and its number of members.

__model__

alias of StatCategory

count = None

Number of members in the group

Type:int
name = None

Name of the tier/group

Type:str
class StatCategory(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class for statistical tier numbers.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class Stats(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class for basic statistical entries.

The information in this class is displayed in the NaMi dashboard in a pie chart.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class StatsSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Stats class

__model__

alias of Stats

nrMitglieder = None

Total number of members in the group

Type:int
statsCategories = None

Detailed information on the partitions

Type:list of StatCategory

pynami.schemas.default module

Schema for default values

class Baseadmin(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Base data class for all default values and their id mapping.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class BaseadminSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the Baseadmin class

All the default values only consist of the same four attributes

__model__

alias of Baseadmin

name = None

Name of this value. This will be empty in many cases.

Type:str

pynami.schemas.grpadmin module

This module contains classes for group admin (Gruppierungsverwaltung) stuff

class Invoice(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Repesents an invoice

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

download(nami, **kwargs)[source]

Download this invoice as PDF

Parameters:
Returns:

None

class InvoiceSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Invoice class

__model__

alias of Invoice

currency = None

Currency (e.g. 'EUR')

Type:str
debitor = None

Id of the debitor

Type:str
debitorKonto = None

Some account id

Type:str
debitorName = None

Debitor, e.g. a group

Type:str
debitor_document_id = None

Some other internal id

Type:int
displayName = None

Human-readable string describing the invoice

Type:str
einzugsDatum = None

Date of money collection

Type:datetime
erloesKtoName = None

This may be empty

Type:str
freigabeDatum = None

When the invoice was released

Type:datetime
get_download_url(data, **kwargs)[source]

Extract the HTML enclosed URL string from the pdf download field

Parameters:data (dict) – Data dictionary
Returns:The updated data dictionary
Return type:dict
id = None

NaMi id

Type:int
pdf = None

Relative download URL

Type:str
reCreated = None

Creation date of the invoice

Type:datetime
reDatum = None

Date of the invoice

Type:datetime
reNr = None

Official invoice number

Type:str
rechnungsLauf = None

Internal invoice number

Type:int
status = None

If the invoice has been released

Type:str
total = None

Total amount

Type:str
zahlungsweise = None

Way of payment (e.g. 'Lastschrift')

Type:str
zahlungsweiseId = None

Id of the way of payment (e.g. 'LASTSCHRIFT')

Type:str
class SearchInvoice(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Repesents an invoice that came up as a search result

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

download(nami, **kwargs)[source]

Download this invoice as PDF

Parameters:
Returns:

None

get_invoice(nami, grpId=None)[source]

Create a real Invoice form the search result by getting the corresponding data set through the training id.

Parameters:
  • nami (NaMi) – Main NaMi class
  • grpId (str, optional) – DPSG Group id. Defaults to group id of the user
Returns:

The invoice object corresponding to this search result.

Return type:

Invoice

class SearchInvoiceSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the SearchInvoice class

__model__

alias of SearchInvoice

entries_debitor = None

Id of the debitor

Type:str
entries_debitorId = None

e.g. a group id

Type:int
entries_debitorName = None

Debitor, e.g. a group

Type:str
entries_debitorType = None

NaMi class

Type:str
entries_debitor_document_id = None

Some other internal id

Type:int
entries_displayName = None

Human-readable string describing the invoice

Type:str
entries_einzugsDatum = None

Date of money collection

Type:datetime
entries_erloesKtoName = None

This may be empty

Type:str
entries_fibuDebitorKonto = None

Some account id

Type:str
entries_fibuErloesKonto = None

This my be empty

Type:str
entries_freigabeDatum = None
Type:datetime
entries_kontoOwnerId = None

Id of the account owner

Type:int
entries_kontoOwnerTyp = None

NaMi class

Type:str
entries_kontoverbindung = None

Account details

Type:str
entries_kreditor = None

May be empty

Type:str
entries_reCreated = None

Creation date of the invoice

Type:datetime
entries_reDatum = None

Date of the invoice

Type:datetime
entries_reMwst = None

VAT amount including currency

Type:str
entries_reNetto = None

Netto amount including currency

Type:str
entries_reNr = None

Official invoice number

Type:str
entries_rechnungsEmpfaenger = None

Recipient

Type:str
entries_rechnungsLauf = None

Internal invoice number

Type:int
entries_status = None

If the invoice has been released

Type:str
entries_zahlungsEmpfaenger = None

Recipient of the payment

Type:str

pynami.schemas.history module

Schemas for history entries

class HistoryEntry(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Main class for history entries

This contains information about an update of a Mitglied which is displayed on the NaMi dashbiard.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

get_history(nami, mglId, ext=True)[source]

Create a real MitgliedHistory form the search result by getting the corresponding data set through the history entry id.

Parameters:
  • nami (NaMi) – Main NaMi class
  • mglId (int) – Member id (not DPSG Mitgliedsnummer)
  • ext (bool, optional) – If the extended history format should be used. Defaults to True.
Returns:

The activity object corresponding to this search result.

Return type:

MitgliedHistory

class HistoryEntrySchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the HistoryEntry class

__model__

alias of HistoryEntry

entries_actor = None

Name of the person who created the change including the id

Type:str
entries_actorId = None

Id of the person who created the change

Type:int
entries_author = None

Who did this

Type:str
entries_changedFields = None

Which fields have been changed. This may be empty.

Type:str
entries_completeChanges = None

More details about the changes. This may be empty.

Type:str
entries_entryDate = None

Date of the event

Type:datetime
entries_gruppierung = None

Group name including its id

Type:str
entries_id = None

NaMi id

Type:int
entries_mitglied = None

Almost the same as entries_author

Type:str
entries_newObject = None

Updated object (‘e.g. a Mitglied)

Type:str
entries_objectClass = None

NaMi class

Type:str
entries_objectId = None

Object id (not the NaMi id for addressing the entry)

Type:int
entries_operation = None

What kind of action has been done.

Type:str
entries_originalObject = None

The object before the change. This may be empty for a GruppierungsHistoryEntry.

Type:str
class MitgliedHistory(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class for a member revision history entry obtained directly from its id.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class MitgliedHistorySchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the MitgliedHistory class

__model__

alias of MitgliedHistory

actor = None

Name of the person who created the change including the id

Type:str
changedFields = None

Which fields have been changed. This may be empty.

Type:str
entryDate = None

Date of the event

Type:datetime
gruppierung = None

Group name including its id

Type:str
id = None

NaMi id

Type:int
operation = None

What kind of action has been done.

Type:str

pynami.schemas.mgl module

Schemas for operations on members

class Mitglied(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class representing a NaMi Mitglied

This class overwrites the __getattr__() and __setattr__() methods so that attributes of this class can be handled in a convenient way. It is intended to be instantiated by calling the load() method on a corresponding data dictionary.

update(nami)[source]

Writes the possibly changed values to the NaMi

Parameters:nami (NaMi) – Main class for communication with the NaMi
Returns:The new Mitglied as it is returned by the NaMi
Return type:Mitglied
class MitgliedSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for a Mitglied

class Meta[source]

Bases: pynami.schemas.base.Meta

Extended marshmallow.Schema.Meta class for further configuration

ordered = True

This is nesseccary for the payment deatils to be dumped in the corrent order.

Type:bool
__model__

alias of Mitglied

austrittsDatum = None

Date of the end of membership

Type:date
beitragsart = None

Fee type

Type:str
beitragsartId = None

Id of the fee type

Type:int
eintrittsdatum = None

Start of membership

Type:date
email = None

Primary member email

Type:str
emailVertretungsberechtigter = None

Email address of an authorized representative.

Type:str
ersteTaetigkeit = None

First activity. May be empty.

Type:str
ersteTaetigkeitId = None

Id of the first activity. Defaults to null.

Type:int
ersteUntergliederung = None

First tier. May be empty

Type:str
ersteUntergliederungId = None

Id of the first tier. This may be empty.

Type:int
fixBeitrag = None

Defaults to null.

Type:str
geburtsDatum = None

Birth date

Type:date
genericField1 = None

Not sure why these even exist.

Type:str
genericField2 = None

Not sure why these even exist.

Type:str
geschlecht = None

Gender

Type:str
geschlechtId = None

Gender id

Type:int
gruppierung = None

Group name including its id

Type:str
gruppierungId = None

Group id

Note

In the search result (see SearchMitgliedSchema) this comes as a str.

Type:int
id = None

NaMi internal id (not DPSG member nummer).

Type:int
jungpfadfinder = None

Tier field. Not sure what it is for.

Type:str
konfession = None

Confession

Type:str
konfessionId = None

Id of the confession

Type:int
kontoverbindung = None

Account details. In a search result this comes as a str.

Type:NamiKontoSchema
land = None

Address country

Type:str
landId = None

Id of the address country

Type:int
lastUpdated = None

Date of the last update. This value is not dumped when updating a Mitglied.

Type:datetime
mglType = None

Type of membership (e.g. 'Mitglied')

Type:str
mglTypeId = None

Id of the type of membership (typically just the value in uppercase).

Type:str
mitgliedsNummer = None

DPSG member number

Type:int
nachname = None

Surname

Type:str
nameZusatz = None

Extra name info

Type:str
ort = None

Address city

Type:str
pfadfinder = None

Tier field. Not sure what it is for.

Type:str
plz = None

Postal code

Type:str
region = None

A Bundesland or foreign country

Type:str
regionId = None

Region id

Type:int
rover = None

Tier field. Not sure what it is for.

Type:str
sonst01 = None

Another generic field. Defaults to False.

Type:bool
sonst02 = None

Another generic field. Defaults to False.

Type:bool
spitzname = None

Nickname

Type:str
staatsangehoerigkeit = None

Nationality

Type:str
staatsangehoerigkeitId = None

Id of the nationality

Type:int
staatsangehoerigkeitText = None

Extra nationality info. Empty in most cases.

Type:str
status = None

If the member is active or not

Type:str
strasse = None

Address information

Type:str
stufe = None

Current tier

Type:str
telefax = None

Fax number. Who uses these anyway today?

Type:str
telefon1 = None

First phone number

Type:str
telefon2 = None

Second phone number

Type:str
telefon3 = None

Third phone number

Type:str
version = None

History version number

Type:int
vorname = None

First name

Type:str
wiederverwendenFlag = None

If the member data may be used after the membership ends

Type:bool
woelfling = None

Tier field. Not sure what it is for.

Type:str
zeitschriftenversand = None

If the member gets the DPSG newspaper.

Type:bool
class NamiKonto(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Holds information about bank account and payment method of the member.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class NamiKontoSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for bank account and payment method information.

This Schema will be nested inside a MitgliedSchema and there should be no other use for it.

__model__

alias of NamiKonto

bankleitzahl = None

Bank sort code

Type:str
bic = None

BIC

Type:str
double_dump(data, **kwargs)[source]

Incoming data sets are nicely formatted json strings which can be loaded easily into the Schema but when you update a Mitglied all payment details have to formatted into a json string and all attributes have to be in a certain order. To achieve this the post_dump() decorator is used.

Parameters:data (dict) – Already dumped data set
Returns:A json formatted string
Return type:str
iban = None

IBAN

Type:str
id = None

NaMi internal id of this payment details

Type:int
id_to_str(data, **kwargs)[source]

For some reason the NaMi gives the id of the payment details as an integer, but when you want to update a member it has be a string. Therefore this method converts incoming ids to a str object before loading them by making use of the pre_load() decorator.

Parameters:data (dict) – Data dictionary to be loaded
Returns:Corrected data dictionary
Return type:dict
institut = None

Bank

Type:str
kontoinhaber = None

Account holder

Type:str
kontonummer = None

Account number

Type:str
mitgliedsNummer = None

DPSG member id

Type:int
zahlungsKondition = None

Kind of payment (e.g. 'Std Lastschrift'). This attribute is not dumped when updating a Mitglied.

Type:str
zahlungsKonditionId = None

Id corresponding to the kind of payment

Type:int
class SearchMitglied(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Main class for a Mitglied which came up as a search result. Unfortunately there cannot be just one Mitglied class because the search results lack crucal imformation (e.g. payment details).

get_mitglied(nami)[source]

Create a real Mitglied form the search result by getting the corresponding data set through the member id.

Parameters:nami (NaMi) – Main NaMi class
Returns:The Mitglied object corresponding to this search result.
Return type:Mitglied
class SearchMitgliedSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for SearchMitglied.

For some reason attribute naming in the NaMi is a bit inconsistent between a Mitglied which comes up as a search result and one that is addressed directly by its id.

__model__

alias of SearchMitglied

entries_austrittsDatum = None

Date of the end of membership

Type:date
entries_beitragsarten = None

Fee type

Type:str
entries_eintrittsdatum = None

Start of membership

Type:date
entries_email = None

Primary member email

Type:str
entries_emailVertretungsberechtigter = None

Email address of an authorized representative.

Type:str
entries_ersteTaetigkeitId = None

Id of the first activity. Defaults to null.

Type:int
entries_ersteUntergliederungId = None

Id of the first tier. This may be empty.

Type:int
entries_fixBeitrag = None

Defaults to null.

Type:str
entries_geburtsDatum = None

Birth date

Type:date
entries_genericField1 = None

Not sure why these even exist.

Type:str
entries_genericField2 = None

Not sure why these even exist.

Type:str
entries_geschlecht = None

Gender

Type:str
entries_gruppierung = None

Group name including its id

Type:str
entries_gruppierungId = None

Group id as a string

Type:str
entries_id = None

NaMi internal id (not DPSG member nummer).

Type:int
entries_jungpfadfinder = None

Tier field. Not sure what it is for.

Type:str
entries_konfession = None

Confession

Type:str
entries_kontoverbindung = None

Account details. For some reason this is not always transmitted and may therefore be empty.

Type:str
entries_lastUpdated = None

Date of the last update

Type:datetime
entries_mglType = None

Type of membership (e.g. 'Mitglied')

Type:str
entries_mitgliedsNummer = None

DPSG member number

Type:int
entries_nachname = None

Surname

Type:str
entries_pfadfinder = None

Tier field. Not sure what it is for.

Type:str
entries_rover = None

Tier field. Not sure what it is for.

Type:str
entries_rowCssClass = None

Unused. The purpose could not be dount out.

Type:str
entries_spitzname = None

Nickname

Type:str
entries_staatangehoerigkeitText = None

Extra nationality info. Empty in most cases.

Type:str
entries_staatsangehoerigkeit = None

Nationality

Type:str
entries_status = None

If the member is active or not

Type:str
entries_stufe = None

Current tier

Type:str
entries_telefax = None

Fax number. Who uses these anyway today?

Type:str
entries_telefon1 = None

First phone number

Type:str
entries_telefon2 = None

Second phone number

Type:str
entries_telefon3 = None

Third phone number

Type:str
entries_version = None

History version number

Type:int
entries_vorname = None

First name

Type:str
entries_wiederverwendenFlag = None

If the member data may be used after the membership ends

Type:bool
entries_woelfling = None

Tier field. Not sure what it is for.

Type:str

pynami.schemas.search module

This module contains the classes for a search for members

class SearchSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Base class for search parameters

You could just use json.dumps() on a dictionary to create the search string but this would bypass all the type and spell checking.

This also takes care of the miss-spelled search key 'mitgliedsNummber' so that the user of this API can use the correct spelling.

Example

Generate the search string
from pynami.search import SearchSchema

searchKeys = {'vorname': 'Max',
              'nachname': 'Mustermann'}
searchedValues = SearchSchema().dumps(searchKeys,
                                      separators=(',', ':'))
print(searchedValues)
Make direct use of the search keys by searching for all Wölflinge and Jungpfadfinder
from pynami.tools import tabulate2x
from pynami.nami import NaMi

with NaMi(username='MITGLIEDSNUMMER', password='PASSWORD') as nami:
    searchResults = nami.search(untergliederungId=[1,2])
    print(tabulate2x(searchResults))
class Meta[source]

Bases: pynami.schemas.base.Meta

Extended marshmallow.Schema.Meta class for further configuration

ordered = True

All attributes shall be dumped in code order

Type:bool
alterBis = None

Maximal age

Type:str
alterVon = None

Minimal age

Type:str
bausteinIncludeId = None

Possible completed trainings

Type:list of int
correct_spelling(data, **kwargs)[source]

Check for missspelled or incorrect data before dumping. Realized by the pre_dump() decorator.

Parameters:data (dict) – Data set to be dumped
Returns:Corrected data
Return type:dict
Raises:KeyError – When there is a search key that is not an attribute of this class
ebeneId = None

Represents a DPSG structural level

Type:int
funktion = None

Unused tag

Type:str
grpName = None

Group name

Type:str
grpNummer = None

Group id

Type:str
gruppierung1Id = None

Group id of a Diözese

Type:int
gruppierung2Id = None

Group id of a Bezirk

Type:int
gruppierung3Id = None

Group id of a Stamm

Type:int
gruppierung4Id = None

Unused

Type:int
gruppierung5Id = None

Unused

Type:int
gruppierung6Id = None

Unused

Type:int
inGrp = None

Whether to search in the group

Type:bool
mglStatusId = None

If the member is active

Type:str
mglTypeId = None

Kind of membership

Type:list of str
mglWohnort = None

City

Type:str
mitAllenTaetigkeiten = None

Whether to search in all active activities

Type:bool
mitgliedsNummer = None

The DPSG id

Type:str
nachname = None

Surname

Type:str
organisation = None

Unused tag

Type:str
privacy = None

Unused

Type:str
searchName = None

Unused

Type:str
searchType = None

Default search type. Not even strictly neccessary.

Type:str
spitzname = None

Nickname

Type:str
taetigkeitId = None

List of activities the mambers are comitted to

Type:list of int
tagId = None

Kinds of fees

Type:list of int
untergliederungId = None

Tiers in which the members are active

Type:int
unterhalbGrp = None

Whether to search in subgroups

Type:bool
vorname = None

First Name

Type:str
withEndedTaetigkeiten = None

Whether to search also in activities that have already ended

Type:bool
zeitschriftenversand = None

If the member gets the DPSG newpaper

Type:bool

pynami.schemas.training module

Schemas for trainings

class Ausbildung(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Main class for a training obtained directly from its id.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class AusbildungSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Ausbildung class

__model__

alias of Ausbildung

baustein = None

Name of the training (e.g. 'Baustein 3a')

Type:str
bausteinId = None

Id of the training

Type:int
id = None

NaMi id

Type:int
lastModifiedFrom = None

Who did the last change to this entry

Type:str
mitglied = None

Who absolved the training

Type:str
veranstalter = None

Who organized the event (e.g. a Bezirk)

Type:str
vstgName = None

Name of the event

Type:str
vstgTag = None

Day of the training event

Type:date
class SearchAusbildung(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Main class for a training obtained as a search result.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

get_ausbildung(nami, mglId)[source]

Create a real Ausbildung form the search result by getting the corresponding data set through the training id.

Parameters:
  • nami (NaMi) – Main NaMi class
  • mglId (int) – Member id (not DPSG Mitgliedsnummer)
Returns:

The activity object corresponding to this search result.

Return type:

Ausbildung

class SearchAusbildungSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the SearchAusbildung class

__model__

alias of SearchAusbildung

entries_baustein = None

Name of the training (e.g. 'Baustein 3a')

Type:str
entries_id = None

NaMi id of this training entry

Type:int
entries_mitglied = None

Who absolved the training

Type:str
entries_veranstalter = None

Who organized the event (e.g. a Bezirk)

Type:str
entries_vstgName = None

Name of the event

Type:str
entries_vstgTag = None

Day of the training event

Type:date

pynami.schemas.tags module

Schemas for tags

class SearchTag(**kwargs)[source]

Bases: pynami.schemas.base.BaseSearchModel

Base data class for a tag that came up as a search result.

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class SearchTagSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSearchSchema

Schema class for the SearchBescheinigung class

__model__

alias of SearchTag

entries_identitaet = None

Identity of the member with the DPSG Mitgliedsnummer

Type:str
entries_tag = None

Actual value of the tag

Type:str
class Tag(**kwargs)[source]

Bases: pynami.schemas.base.BaseModel

Base data class for a tag

This class is intended to be instantiated by calling the load() method on a corresponding data dictionary.

class TagSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet = False, unknown: str | None = None)[source]

Bases: pynami.schemas.base.BaseSchema

Schema class for the Tag class

__model__

alias of Tag

id = None

Id of this tag

Type:int
mitglied = None

Surname and first name of the member this tag belongs to

Type:str
mitgliedId = None

Member id (not DPSG Mitgliedsnummer)

Type:int
tag = None

Actual value of the tag

Type:str
tagId = None

Same as id

Type:int