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_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_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.15.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

pyelternportal-0.0.15-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyelternportal-0.0.15.tar.gz
Algorithm Hash digest
SHA256 425730fd3558ff1ca3c7137981ed33c66b9a0541e69e5e6ae195dd6f36a192bc
MD5 dc41ec358866132570aa7dd1fa330c57
BLAKE2b-256 253573e781b6fe0c8234f224d8f688309b753c9611f9bb0455ce1da44978c295

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyelternportal-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 f29e05be6637ef154e51e020b26d80d315369c4f921c92705d66510a412fa4c0
MD5 4137ad84e179ed3d1ee7e86a8e851125
BLAKE2b-256 b284dd27dd91e6b193c1da136e040ba51a9ac41da18b43c182e463ebde91face

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