@studentsphere/ots-core
v1.0.1
Published
Shared interfaces and contracts for Open Timetable Scrapper providers
Maintainers
Readme
The core library for the Open Timetable Scraper (OTS) ecosystem by StudentSphere.
This package provides the foundational TypeScript interfaces, types, and the base class required to build custom timetable scraper providers. By standardizing the data structures, OTS ensures that any provider can seamlessly integrate with the Open Timetable Scraper server.
Installation
npm install @studentsphere/ots-coreWhat's included?
BaseTimetableProvider
An abstract class that all custom providers must extend. It enforces the implementation of essential metadata and methods:
id: Unique identifier for the provider.name: Display name of the provider.logo: URL to the provider's logo.schools: Array of supported schools/campuses.validateCredentials(credentials): Method to verify user login details.getSchedule(credentials, from, to): Method to scrape and return the timetable data.
Core Interfaces
Course: The standardized format for a single class/event (includes subject, start/end times, location, teacher, color, etc.).School: Represents a school or campus supported by a provider.ProviderCredentials: Standardized login credentials (identifier and password).
Building a Provider
If you want to build your own provider, you must extend the BaseTimetableProvider class from this package.
For a complete step-by-step guide and a working template, please check out the @studentsphere/ots-provider-example package.
License
MIT
