Search Mitglieder

For validation of the search parameters the following class is used:

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]

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))
__model__

alias of pynami.schemas.base.BaseModel

Search Keys

SearchSchema.vorname

First Name

Type:str
SearchSchema.funktion

Unused tag

Type:str
SearchSchema.organisation

Unused tag

Type:str
SearchSchema.nachname

Surname

Type:str
SearchSchema.alterVon

Minimal age

Type:str
SearchSchema.alterBis

Maximal age

Type:str
SearchSchema.mglWohnort

City

Type:str
SearchSchema.mitgliedsNummer

The DPSG id

Type:str
SearchSchema.mglStatusId

If the member is active

Type:str
SearchSchema.mglTypeId

Kind of membership

Type:list of str
SearchSchema.tagId

Kinds of fees

Type:list of int
SearchSchema.bausteinIncludeId

Possible completed trainings

Type:list of int
SearchSchema.spitzname

Nickname

Type:str
SearchSchema.zeitschriftenversand

If the member gets the DPSG newpaper

Type:bool
SearchSchema.untergliederungId

Tiers in which the members are active

Type:int
SearchSchema.taetigkeitId

List of activities the mambers are comitted to

Type:list of int
SearchSchema.mitAllenTaetigkeiten

Whether to search in all active activities

Type:bool
SearchSchema.withEndedTaetigkeiten

Whether to search also in activities that have already ended

Type:bool

Restrict search to some group or level

There are two way to search only in a specified group or level which are mutually exclusive:

1. Choose the level and specify the group id and/or the group name

SearchSchema.ebeneId

Represents a DPSG structural level

Type:int
SearchSchema.grpNummer

Group id

Type:str
SearchSchema.grpName

Group name

Type:str

2. Choose group ids from different levels from a automated list

SearchSchema.gruppierung1Id

Group id of a Diözese

Type:int
SearchSchema.gruppierung2Id

Group id of a Bezirk

Type:int
SearchSchema.gruppierung3Id

Group id of a Stamm

Type:int
SearchSchema.inGrp

Whether to search in the group

Type:bool
SearchSchema.unterhalbGrp

Whether to search in subgroups

Type:bool

Unused search keys

SearchSchema.gruppierung4Id

Unused

Type:int
SearchSchema.gruppierung5Id

Unused

Type:int
SearchSchema.gruppierung6Id

Unused

Type:int
SearchSchema.privacy

Unused

Type:str
SearchSchema.searchName

Unused

Type:str
SearchSchema.searchType = 'MITGLIEDER'

Default search type. Not even strictly neccessary.

Type:str