Skip to main content

BLA-API-Wrapper.

Description

Reverse engineering of Beacon Light Academy's Homework App.

Table of Contents

Installation

The library is available on PyPI, install using pip.

pip install BlaApi

Or update it.

pip install BlaApi --upgrade

Quick Start

The code below returns a list of 'notification_ids' The date needs to be in the format; 'Abbreviated_Day, DD/MM/YYYY'

from BlaApi import Client
username = 'my username'
password = 'my password'

notification_ids = c.search_by_date("Thu, 13/04/2023")
print(notification_ids)
Output:
['3049357', '3049213', '3038795', '3038038', '3036497', '3036305']

We can use 'notification ids' to make api calls and retrieve useful information.

from BlaApi import Client
c = Client(username, password)
diary_data = c.get_diary_data(notification_ids)
print(diary_data)

The output consists of a list of dictionaries which contain details for the corresponding notification id.

Output:
[{
        "studentId": "8326",
        "id": "3049213",
        "appDiaryId": "64980",
        "title": "Class work - 13th April",
        "details": "**Book: TBS**\n\
**Unit 06: Setting up a company**\n
**Chapter 01: Gathering information**\n\n
Chapter completed; discussed all activities. 'Sharpen your skills' also covered.\n\n",
        "bRead": "1",
        "created": "2023-04-13 10:05:25",
        "diaryType": "cw",
        "dateDue": None,
        "attachment": None,
        "attachment2": None,
        "dateSubmitted": None,
        "subject": "ENGLISH LANGUAGE",
        "currentTimestamp": "2023-04-15 15:25:21",
        "assignmentId": "64980",
        "gr_no": "12266",
        "comments": [],
},
]

The html is converted to markdown.

Check out some examples or read the documentation.

Documentation

This is some boilerplate code you should be familiar with.

from BlaApi import Client
username = 'my username'
password = 'my password'

c = Client(username, password)

Keep in mind that In the api, the 'notificationId' and 'id' variables are used interchangeably.

The 'login()' method allows you to retrieve information such as: auth token and student information such as class, section student_name, gr_number, student_id.

The 'get_diary_list()' method will return a list of all the diaries available in the app's database, which allows you to retrieve information such as: date posted, subject name, assignment id, notification id (id), title, description, diary type (cw/hw), if the diary has been read (bRead) and the student id which the diary corresponds to.

The 'get_diary_data()' method allows you to get the content of the diary itself, by passing a list of notification ids. it has options such as: student id, app diary id (assignment id), attachment id, comments and the rest is the same as get_diary_list()

The there are methods to parse and sort through the diary list, and return notification ids for the entries. The methods inside it also allow you to also pass in a list of notification ids as a second argument using its 'passthru' variable.

The 'get_current_date()' method from 'Diary' returns today's date in a format that the api needs to function. (Abbreviated_Day, DD/MM/YYYY)

The 'search_by_student' method from 'Diary' returns the notification_ids for one of the students registered on your account. By default it sets student_number = 0, meaning it will return diaries for the first student by default.

The other methods from 'Diary' are: 'search_by_date(date)', and 'search_been_read(True/False)'. They are self explanatory.

To-Do

  • Add methods for interacting with more features

    • Comments

    • Description

    • Student info

    • Attachments

  • Make better doccumentation

My motivation to create this

Simply put, I found my school's app to be subpar, so I'm attempting to create a better one.

Feel free to open an issue if you have any questions, and star the repo if you're cool

Metadata

Release files for BlaApi 2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BlaApi 2.1
File Size Uploaded
BlaApi-2.1.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for BlaApi 2.1
File Interpreter ABI Platform
BlaApi-2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 14.3 kB

Release files / BlaApi-2.1.tar.gz

Download URL BlaApi-2.1.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
00909fe6208d3283c8bf469c82018ddba94a8abae37dcf7b98c8073634cf051d
BLAKE2b-256 checksum
How to use checksums
20ed6966bae2dc0c896750ecd69ef3442d49d98da2eaf7cb859a0946175c5773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / BlaApi-2.1-py2.py3-none-any.whl

Download URL BlaApi-2.1-py2.py3-none-any.whl
Size 6.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e4062423668ac3f281204db7ae120a1fad2fa32fcad6b432a660c499a1e239fc
BLAKE2b-256 checksum
How to use checksums
1d55867cd2170aae91c9775747ed229febd2c467342208804dbe3ab94c26b62f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.1 This release

2 release files

2.0

2 release files

1.9

2 release files

1.8

2 release files

1.7

2 release files

1.6

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page