Python library for the University of Edinburgh's T@Ed Timetabling Service
Project description
python-ted
==========
Python library for the University of Edinburgh's [T@Ed Timetabling Service][ted].
**Disclaimer: This library has not been condoned by the University of Edinburgh.**
`python-ted` is built by students, and simply scrapes the existing timetable web service,
since no APIs or timetabling data have been released by the university.
## Installation
```sh
pip install python-ted
```
### Requires
- [`icalendar`][icalendar]
- [`lxml`](http://lxml.de/)
- [`requests`](https://pypi.python.org/pypi/requests)
## Usage
```python
>>> import icalendar
>>> import ted
# Initialise client and download course-list
>>> timetable = ted.Client()
# Regex match against course list:
>>> import re
>>> timetable.match(re.compile('Data'))
[<Course: INFR08015 (Informatics 1 - Data and Analysis)>, <Course: ...>, ...]
>>> timetable.match(re.compile('INFR08015'))
[<Course: INFR08015 (Informatics 1 - Data and Analysis)>]
# Get a specific course by course-code
>>> timetable.course(code='INFR08015')
<Course: INFR08015 (Informatics 1 - Data and Analysis)>
>>> timetable.course(code='invalid course code')
None
```
Each `Course` object has 3 main attributes:
- `title`: human-readable course name.
- `code`: University of Edinburgh course code (seen on timetables or exam scripts).
- `identifier`: T@Ed-specific course identifier.
```python
>>> course = timetable.course(code='INFR08015')
# Scrape T@Ed for list of weekly course events, and build an ical calendar
>>> events = timetable.events(course)
>>> cal = timetable.calendar(events)
# Render calendar to a bytestring
>>> cal.to_ical()
"BEGIN:VCALENDAR..."
```
Future
------
- Get API access for T@Ed.
License
-------
This Source Code is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
[ted]: https://www.ted.is.ed.ac.uk/UOE1314_SWS/
[icalendar]: https://pypi.python.org/pypi/icalendar
==========
Python library for the University of Edinburgh's [T@Ed Timetabling Service][ted].
**Disclaimer: This library has not been condoned by the University of Edinburgh.**
`python-ted` is built by students, and simply scrapes the existing timetable web service,
since no APIs or timetabling data have been released by the university.
## Installation
```sh
pip install python-ted
```
### Requires
- [`icalendar`][icalendar]
- [`lxml`](http://lxml.de/)
- [`requests`](https://pypi.python.org/pypi/requests)
## Usage
```python
>>> import icalendar
>>> import ted
# Initialise client and download course-list
>>> timetable = ted.Client()
# Regex match against course list:
>>> import re
>>> timetable.match(re.compile('Data'))
[<Course: INFR08015 (Informatics 1 - Data and Analysis)>, <Course: ...>, ...]
>>> timetable.match(re.compile('INFR08015'))
[<Course: INFR08015 (Informatics 1 - Data and Analysis)>]
# Get a specific course by course-code
>>> timetable.course(code='INFR08015')
<Course: INFR08015 (Informatics 1 - Data and Analysis)>
>>> timetable.course(code='invalid course code')
None
```
Each `Course` object has 3 main attributes:
- `title`: human-readable course name.
- `code`: University of Edinburgh course code (seen on timetables or exam scripts).
- `identifier`: T@Ed-specific course identifier.
```python
>>> course = timetable.course(code='INFR08015')
# Scrape T@Ed for list of weekly course events, and build an ical calendar
>>> events = timetable.events(course)
>>> cal = timetable.calendar(events)
# Render calendar to a bytestring
>>> cal.to_ical()
"BEGIN:VCALENDAR..."
```
Future
------
- Get API access for T@Ed.
License
-------
This Source Code is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
[ted]: https://www.ted.is.ed.ac.uk/UOE1314_SWS/
[icalendar]: https://pypi.python.org/pypi/icalendar
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
python-ted-0.0.5.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for python_ted-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6faa6d04a478418d3e08eb2b17da027a45f56a3909e7eea8f22fdc292e3d553f |
|
MD5 | 3d8a8cadf2067c3e257b7da67641da5c |
|
BLAKE2b-256 | 4db0b53ac0e94e2ab72769d46a958e782de8469454a7119669be94d10d0be5d8 |