eschool-py

Python library to work with Eschool electronic diary


License
MIT
Install
pip install eschool-py==0.9

Documentation

Eschool

Python library to work with Eschool electronic diary (https://eschool.center)

Getting Started

Logging in for the first time:

from eschool import EschoolClient


client = EschoolClient.login('your_username', 'your_password')
# you can also write Eschool.login('your_username') and you will be prompted for your password

Saving and restoring session:

# Saving:
client.save(filename)
# Restoring:
client = EschoolSession.from_file(filename)

Getting marks, homeworks and chats:

client.marks()
client.homeworks()
client.chats()

Event handling:

import re


@client.on_message
def process_message(msg):
    print('New message:', re.sub(r'<[^>]*>', '', msg['msg']))   # re to remove markup from message

@client.on_mark
def process_mark(mark):
    print(f'New mark: {mark[0]} for subject {mark[5]}')

@client.on_homework
def process_homework(hw):
    print(f"New homework: {homework[3]} for subject {homework[1]}")

Installing

sudo pip3 install eschool