Package librusapi
Python package librusapi provides functions
and objects for interfacing with Librus Synergia.
All of this is archieved using the requests
library for fetching data and BeaufifulSoup4
for scraping the data
Contents
librusapi - A Librus Synergia scraper
Goal of this project is to free students from the limitations of Librus Synergia software mainly: giving the user fresh information unlike their mobile app that can only refresh every 3h or so.
Install
Code: sh
pip install librusapi
Tech Used
-
written in
pythondeveloped with3.9in mind -
requestslibrary for fetching data, mainly html -
BeautifulSoup4library for parsing the data
Development specific ~~~~~~~~~~~~~~~~~~~~
-
mypyfor type checking -
pytestfor running tests -
pdocfor creating html documentation
Quick start
Example usage of the API
Getting the timetable ~~~~~~~~~~~~~~~~~~~~~
.. code:: python
from librusapi.token import get_token
from librusapi import timetable
token = get_token('username', 'password')
lesson_units = timetable.lesson_units(token)
for lu in lesson_units:
print(lu)
Listing messages ~~~~~~~~~~~~~~~~
Code: python
from librusapi.token import get_token from librusapi import messages
token = get_token('username', 'password') messages = messages.list_messages(token)
for msg in messages: print(msg)
Documentation
Docs can be found here <https://ravensiris.github.io/librusapi/>_
Working On The Project
Code: sh
git clone https://github.com/ravensiris/librusapi cd librusapi python -m venv venv
This may be different depending on your operating system and shell
source ./venv/bin/activate pip install -r requirements.txt
Installing as an editable library
pip install -e .
Now you can import librusapi in your project
Generating docs ~~~~~~~~~~~~~~~
Code: sh
pdoc –html librusapi
Status
Currenty you can:
-
Authenticate and get a token
-
List all lessons in a timetable
-
List all messages ( can't read them yet )
Expand source code
"""
Python package `librusapi` provides functions
and objects for interfacing with Librus Synergia.
All of this is archieved using the `requests`
library for fetching data and `BeaufifulSoup4`
for scraping the data
.. include:: ../README-pypi.rst
"""
Sub-modules
librusapi.exceptionslibrusapi.helperslibrusapi.messageslibrusapi.timetablelibrusapi.tokenlibrusapi.urls