Skip to main content

A librus api made in python.

Project description

Dokumentacja w języku polskim jest tutaj.


Table of contents

  1. Intro
  2. Instalation
  3. Exmaple usage
  4. Functions


API for librus e-register.
There is no guarantee of developing this API further more!



Example usage

from py_librus_api import Librus

librus = Librus()

"""Loops until user logs in successfully"""
while not librus.logged_in:
    if not librus.login(login, password):
        print("Log in failed! Check your username and/or password!")
        print("Logged in successfully!")

# Your code goes here

More info in functions


Required params/functions are marked with ! prefix.
* means that there is explanation below or something is optional.

!login(!login, !password)

Function returns true if logging in was successful and false when not.
login - Variable that contains user login.
password - Variable that contains user password.
Example usage:

librus.login(login_var, password_var)

You can check if user is logged in!

if librus.logged_in:

If user is not logged in, "User not logged in" exception will be raised!

If connection error occurs, "Connection error" will be raised!


Returns lucky number (int).


For displaying grades in the console, it is recommended to use pretty-print (pprint)! Returns all user grades in this foramt:

grades = {
  "Biologia": [
      "Grade": "5",
      "Weight": "3",
      "Category": "Kartkówka",
      'Teacher': {'FirstName': 'Jan', 'LastName': 'Kowalski'},
      "Comment": "kartkówka z działu o płazach",
      "To_the_average": "Tak"

Note that subject names are in language provided by Librus API (in this example it's polish)


Returns teachers' personal data (firstname, lastname) in couple of formats. You can choose format like that:

librus.get_teachers(mode="print") # etc.

List of formats:

normal (default)

  1123576: {'FirstName': 'Jan', 'LastName': 'Kowalski'},
  1983456: {'FirstName': 'Grażyna', 'LastName': 'Kowalska'},


  "Jan Kowalski",
  "Grażyna Kowalska",


  '1476937: Jan Kowalski',
  '1484010: Grazyna Kowalska',


Returns a list of days free from school. Format:

    {'DateFrom': '2019-01-01', 'DateTo': '2019-01-01', 'Name': 'Nowy Rok'},


Returns a list of teachers' absence. Format:

        'DateFrom': '2018-10-24',
        'DateTo': '2018-10-26',
        'Teacher': {'FirstName': 'Jan', 'LastName': 'Kowalski'},
        'TimeFrom': '13:40:00',
        'TimeTo': '15:15:00',
        'Type': 'szkolenie'

It can happen that TimeFrom and TimeTo won't exist!


Returns attendances in this format:

{'AddDate': '2018-10-29 12:52:51',
  'AddedBy': {'FirstName': 'Jan', 'LastName': 'Kowalski'},
  'Date': '2018-10-29',
  'Id': 123456,
 'Lesson': {'Subject': 'Chemia',
            'Teacher': {'FirstName': 'Jan', 'LastName': 'Kowalski'}},
 'LessonNo': 6,
 'Semester': 1,
 'Type': {'IsPresenceKind': True,
           'Name': 'Obecność',
           'Order': 1,
           'Short': 'ob',
           'Standard': True}

Project details

Download files

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

Files for py-librus-api, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size py_librus_api-0.3.1.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page