Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/szkolny-eu/timetables-parser-optivum
VULCAN® Optivum® timetable parser library
https://github.com/szkolny-eu/timetables-parser-optivum
Last synced: about 1 month ago
JSON representation
VULCAN® Optivum® timetable parser library
- Host: GitHub
- URL: https://github.com/szkolny-eu/timetables-parser-optivum
- Owner: szkolny-eu
- License: mit
- Created: 2021-11-13T18:31:14.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-13T18:33:01.000Z (about 3 years ago)
- Last Synced: 2024-02-12T17:07:17.555Z (11 months ago)
- Language: Python
- Size: 40 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VULCAN® Optivum® timetable parser library
This library provides access to public timetables generated using the "Plan lekcji Optivum" software.
The resulting dataset is compatible with and based on [timetables-lib](https://github.com/szkolny-eu/timetables-lib).## Usage examples
```python
async with OptivumParser() as parser:
# specify an entire timetable
file = File(path="https://www.school.pl/plan/index.html")
# specify a single timetable (class, teacher, classroom)
file = File(path="https://www.school.pl/plan/plany/o3.html")
# specify a local timetable
file = File(path="C:/html/index.html")
# enqueue and parse all (you can specify more files)
ds = await parser.run_all(file)
# enqueue, then parse
parser.enqueue(file)
ds = await parser.run_all()# sort lessons, because why not
lessons = sorted(ds.lessons, key=lambda x: (x.weekday, x.number))
# print lessons for a specific class
print("\n".join(str(s) for s in lessons if s.register_.name == "1A"))
```## Command-line scripts
Available after installing the package (if scripts directory is in your `PATH`, or you're using a virtualenv).
```shell
$ optivum https://www.school.pl/plan/index.html --register 1A
Parsing 'https://www.school.pl/plan/index.html'
Lesson(...)
Lesson(...)
...
```