Skip to main content

API to retrieve data from Eltern-Portal

Project description

pyelternportal

Project Maintenance GitHub Release GitHub Activity License Code style: black

Python client library to retrieve data provided by eltern-portal.org

Install

pip install pyelternportal

Demo school

With the school identifier "demo" you can try out the library without access data.

Example

Get the letters of the demo school.

import pyelternportal

api = pyelternportal.ElternPortalAPI()
api.set_config("demo", "", "")
api.set_option(letter=True)
await api.async_validate_config()
print(f"school_name:\t{api.school_name}")

await api.async_update()
print(f"last_update:\t{api.last_update}")

for student in api.students:
    print("---")
    print(f"student_id:\t{student.student_id}")
    print(f"fullname:\t{student.fullname}")
    print(f"firstname:\t{student.firstname}")
    print(f"letters:\t{len(student.letters)}")
    for letter in student.letters:
        print(f"\tnumber:\t\t{letter.number}")
        print(f"\tsent:\t\t{letter.sent}")
        print(f"\tsubject:\t{letter.subject}")

API

Methods

Method Description
set_config, set_config_data Set the base configuration
set_option, set_option_treshold, set_option_register, set_option_data Set the optional configuration
async_validate_config Validate base config, set property school_name
async_update Update data, set properties students and last_update

set_config

Set the required configuration.

Parameter Type Description
school str School identifier for Eltern-Portal. A list of valid school identifiers can be found at SCHOOLS.md
username str User name of the access data (e.g. e-mail address)
password str Password of the access data

set_config_data

Set the base configuration via a dictionary object.

Parameter Type Description
config Dict[str, str] The dictionary keys corresponds to the parameter names of set_config.

set_option

Set the optional configuration.

Parameter Type Default Description
appointment bool False Get data of page "service/termine"?
blackboard bool False Get data of page "aktuelles/schwarzes_brett"?
lesson bool False Get data of page "service/stundenplan"?
letter bool False Get data of page "aktuelles/elternbriefe"?
message bool False Get data of page "meldungen/kommunikation_fachlehrer"?
poll bool False Get data of page "aktuelles/umfragen"?
register bool False Get data of page "service/klassenbuch"?
sicknote bool False Get data of page "meldungen/krankmeldung"?

set_option_treshold

Set the optional treshold values.

Parameter Type Default Description
blackboard_treshold int -7 Treshold value (relative to today) for black board sent
letter_treshold int -7 Treshold value (relative to today) for letter sent
message_treshold int -7 Treshold value (relative to today) for message sent
register_treshold int +0 Treshold value (relative to today) for register completion
sicknote_treshold int -7 Treshold value (relative to today) for sick note end

set_option_register

Set the optional configuration for class register.

Parameter Type Default Description
register_start_min int -6 Start date (relative to today) (minimum)
register_start_max int +5 Start date (relative to today) (maximum)
register_show_empty bool False Show empty entries?

set_option_data

Set the option data via a dictionary object.

Parameters Type Description
config Dict[str, Any] The dictionary keys correspond to the parameter names of set_option and set_option_register.

Properties

Property Type Description
hostname str Hostname of the server
base_url str Base url of the web site
school_name str Name of the school presented on the welcome page
students list[Student] List of students (or pupils)
last_update datetime.datetime Timestamp of the last update of the data above

Classes

Student

Property Type Description
student_id str Id of the student
fullname str Full name of the student presented in the drop down list
firstname str First name (extracted from fullname)
lastname str Last name (extracted from fullname)
classname str Class name (extracted from fullname)
appointments list[Appointment] List of appointments (only if option appointment was set)
blackboards list[BlackBoard] List of black board entries (only if option blackboard was set)
lessons list[Lesson] List of lessons (only if option lesson was set)
letters list[Letter] List of letters (only if option letter was set)
messages list[Message] List of messages (only if option message was set)
polls list[Poll] List of polls (only if option poll was set)
registers list[Register] List of registers (only if option register was set)
sicknotes list[SickNote] List of sick notes (only if option sicknote was set)

Appointment

Property Type Description
appointment_id str Id of the appointment
title str Title
short str Short title
classname str Class name
start datetime.date Start (including)
end datetime.date End (including)

BlackBoard

Property Type Description
sent datetime.date Publication date
subject str Subject
body str Body
attachment Attachment Attachment

Lesson

Property Type Description
weekday int 1=Monday ... 5=Friday
number str Sequence number
subject str Subject
room str Room

Letter

Property Type Description
letter_id str Id of the letter
number str Number
sent datetime.datetime Publication date and time
new bool Is it new (or has it already been read)?
attachment bool Has attachment?
subject str Subject
distribution str Distribution
description str Description

Message

Property Type Description
sender str Sender (teacher)
sent datetime.datetime Date and time
subject str Subject
body str Body

Poll

Property Type Description
title str Title
href str Link to details
attachment bool Has attachment
vote datetime.datetime Vote date and time
end datetime.datetime End date and time of runtime
detail str Details

Register

Property Type Description
subject str Subject
short str Short subject
teacher str Teacher
lesson str Lesson
substitution bool Was a substitution?
empty bool Is empty?
rtype str Type of register
start datetime.date Start date (including)
completion datetime.date Complete by date (including)
description str Description

SickNote

Property Type Description
start datetime.date Start date
end datetime.date End date
comment str Comment

Attachment

Property Type Description
atype str Type of attachment: default or lesson
aid int Id of attachment
name str Name
href str Link
size float Size in KB

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyelternportal-0.0.16.tar.gz (64.9 kB view details)

Uploaded Source

Built Distribution

pyelternportal-0.0.16-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file pyelternportal-0.0.16.tar.gz.

File metadata

  • Download URL: pyelternportal-0.0.16.tar.gz
  • Upload date:
  • Size: 64.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyelternportal-0.0.16.tar.gz
Algorithm Hash digest
SHA256 22bb6460c8100e7340d0cc9046186ad60bb3d4b4ecf9ab8c2e18b65bc584821e
MD5 0464d205c605dff35287ed1fad44afb2
BLAKE2b-256 e5d07e693aa2bc51db58700adc1e30893417a8c17be39ea7281d7ec587ed65ce

See more details on using hashes here.

File details

Details for the file pyelternportal-0.0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for pyelternportal-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 ea45b45bfafd358b0f1dd9088337383398b159e0f6cad060c41beea218f91a21
MD5 e05d02f34f6eafa1c8456ca74736a5d4
BLAKE2b-256 68c245e98d68682b4f0bcdf743ca090f2510bdb895f7227f38e31cecc53da70c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page