Download the PHP package yannxtrem/grsu-timetable without Composer
On this page you can find all versions of the php package yannxtrem/grsu-timetable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package grsu-timetable
GRSU Timetable
A PHP scraper library for fetching and parsing student group class schedules from the Yanka Kupala State University of Grodno (GRSU) online timetable at raspisanie.grsu.by.
Features
- Scrapes weekly schedules from the GRSU timetable portal
- Parses weekday, date, time, discipline, lecturer, subgroup, and classroom data
- Built-in in-memory cache with configurable TTL
- Drop-in Laravel cache adapter via service provider
toArray()output format compatible with the existing Python/Flask API- Supports both plain PHP and Laravel integration
Requirements
- PHP ^8.1
- GuzzleHttp ^7.0
- Symfony DomCrawler + CSS Selector ^6.0 | ^7.0
Installation
Laravel auto-discovery registers the service provider automatically.
Quick Start
Plain PHP
Laravel
The package auto-registers via extra.laravel.providers in composer.json. You can publish the config:
Resolve via dependency injection or the alias:
Usage
forDate()
Fetches the weekly schedule containing the given date. This is the primary entry point.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
$date |
DateTimeInterface\|string |
required | Date in Y-m-d format or a DateTime object |
$groupParams |
array |
[] |
Override for arg0-arg4 group parameters |
$forceRefresh |
bool |
false |
Bypass cache and re-scrape |
$scrapeIfMissing |
bool |
true |
Auto-scrape when not found in cache |
Returns: ?ScheduleWeek
Throws: InvalidArgumentException if the date string is malformed.
getByGroup()
Retrieves a schedule by group name and week number, using cache-first lookup.
Returns null if not cached and no URL is provided.
scrapeUrl()
Scrapes a raw URL directly, bypassing cache read. The result is always stored in cache.
Cache Management
Configuration
Publish the config file in Laravel:
This creates config/grsu-timetable.php:
Data Models
All models implement toArray() for serialization and fromArray() for deserialization.
ScheduleWeek
| Property | Type | Description |
|---|---|---|
$weekNumber |
int |
Week number on the timetable |
$groupName |
string |
Student group name |
$days |
ScheduleDay[] |
Array of days in the week |
ScheduleDay
| Property | Type | Description |
|---|---|---|
$weekday |
int |
Day of week (0 = Monday, 6 = Sunday) |
$monthday |
int |
Day of month |
$classes |
ScheduleClass[] |
Classes scheduled for this day |
ScheduleClass
| Property | Type | Description |
|---|---|---|
$subject |
Subject |
The discipline being taught |
$time |
ScheduleTime |
Start and end times |
$subgroup |
string |
Subgroup name ("Tous" if none) |
$door |
?string |
Classroom/auditorium (null if not specified) |
ScheduleTime
| Property | Type | Description |
|---|---|---|
$start |
DateTimeImmutable |
Class start time |
$end |
DateTimeImmutable |
Class end time |
Subject
| Property | Type | Description |
|---|---|---|
$name |
string |
Discipline name |
$lecturer |
Lecturer |
Assigned lecturer |
Lecturer
| Property | Type | Description |
|---|---|---|
$name |
string |
Lecturer name |
Array Output Format
The toArray() method produces a structure matching the existing Python/Flask API:
Cache
The package ships with two cache implementations:
| Store | Description |
|---|---|
ArrayCacheStore |
In-memory cache with TTL (default) |
LaravelCacheStore |
Wraps Laravel's Cache::store() |
In Laravel, the service provider automatically uses LaravelCacheStore when cache.enabled is true in the config.
Testing
Tests use Guzzle MockHandler against a local HTML fixture -- no network requests are made.
License
MIT
All versions of grsu-timetable with dependencies
guzzlehttp/guzzle Version ^7.0
symfony/css-selector Version ^6.0|^7.0
symfony/dom-crawler Version ^6.0|^7.0