Skip to main content

Schedule Module for bonch

Project description

Модуль расписания СПБГУТ

Установка

pip install bonch-schedule

Пример

Через билдер

import requests
from bonch.schedule.ScheduleBuilder import ScheduleBuilder
from bonch.schedule.site.SiteScheduleType import SiteScheduleType
from bonch.schedule.site.groups.GroupListService import GroupListService


session = requests.session()

builder = ScheduleBuilder(
    session=session
)
# Расписание из лк
schedule = builder.with_lk(session_id="yourmidenfromlkcookies") 

# Или

# Расписание с сайта
schedule_type = SiteScheduleType.FULL_TIME_AND_EVENING_LESSONS

# Получаем факультеты и группы в них по типу расписания 
groups_service = GroupListService(session)
faculties = groups_service.faculties(schedule_type)
selected_group = faculties[0].groups[0]

schedule = builder.with_site(
    group_id=selected_group.group_id,  # Id группы с сайта
    schedule_type=schedule_type  # Тип расписания
)

print(f"today schedule: {schedule.today()}")

print(f"today week schedule: {schedule.week()}")

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

bonch_schedule-0.0.1.tar.gz (35.3 kB view hashes)

Uploaded Source

Built Distribution

bonch_schedule-0.0.1-py3-none-any.whl (19.7 kB view hashes)

Uploaded Python 3

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