Skip to main content

Parser and analytics library for Innopolis University schedule

Project description

Innopolis Schedule API

Parser and analytics helpers for Innopolis University schedules. It wraps a Google Sheets reader with a small parser and filter helpers.

Install / Package

  • Install locally for development: pip install -e .
  • Build artifacts pip understands (sdist + wheel): python -m pip install --upgrade build then python -m build. Packages land in dist/ and can be installed with pip install dist/innoscheduleapi-0.1.0-py3-none-any.whl.
  • Publish to a private index/PyPI using the generated wheel or sdist (twine upload dist/* if desired).

Credentials

The library expects a Google service account JSON key. Point to it explicitly or via GOOGLE_APPLICATION_CREDENTIALS.

Examples

Fetch and parse a sheet

import os
from innosched.sheets_client import SheetsClient
from core.parser import ScheduleParser

credentials = os.environ["GOOGLE_APPLICATION_CREDENTIALS"]  # or a hardcoded path
spreadsheet_id = "your-spreadsheet-id"
sheet_name = "Fall 2024"

client = SheetsClient(credentials, spreadsheet_id, use_cache=True)
raw_values = client.get_sheet_data(sheet_name)
schedule = ScheduleParser().parse(sheet_name, raw_values)

for day in schedule.days:
    print(day.name)
    for lesson in day.lessons:
        print(" ", lesson.time, lesson.groups)

Filter lessons by teacher

import os
from innosched.sheets_client import SheetsClient
from core.parser import ScheduleParser
from analytics.filters import filter_by_teacher

creds = os.environ["GOOGLE_APPLICATION_CREDENTIALS"]
sheet_id = "your-spreadsheet-id"
sheet_name = "Fall 2024"

client = SheetsClient(creds, sheet_id)
parsed = ScheduleParser().parse(sheet_name, client.get_sheet_data(sheet_name))

for day, time, group, data in filter_by_teacher(parsed, "Doe"):
    print(f"{day} {time} {group}: {data.subject} @ {data.room}")

Use an explicit cache location

from innosched.cache import Cache
from innosched.sheets_client import SheetsClient

cache = Cache(db_path="/tmp/innosched_cache.db")
client = SheetsClient("credentials.json", "your-spreadsheet-id", use_cache=False)
client.cache = cache  # plug in your own cache instance
values = client.get_sheet_data("Fall 2024")

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

innoscheduleapi-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

innoscheduleapi-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file innoscheduleapi-0.1.1.tar.gz.

File metadata

  • Download URL: innoscheduleapi-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for innoscheduleapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a6b581988556e05b5053cf63f0622752d414287fd1a0ad1986edf2cfec136ea0
MD5 37c2fdfbc14cb1daf72b36040a59074e
BLAKE2b-256 4eb37da1df24bfca1f957c3ca4871b804eda693c373de2e8417a16d4bb5caae1

See more details on using hashes here.

File details

Details for the file innoscheduleapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for innoscheduleapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 941737466f4d4272a534a94f7b5b4d1149174558789dd66bb07af1c549a20192
MD5 0993b5b46f4c9fe0a7246e38d73bc04e
BLAKE2b-256 c20cad4cb2dda57b361cfe99cb1c0aea35b9d3d186b925774d912452f5a5dd38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page