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
Metadata
Release files for python-ted 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-ted-0.0.6.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_ted-0.0.6-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.2 kB
Release files / python-ted-0.0.6.tar.gz
| Download URL | python-ted-0.0.6.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f083347869486999a1e559e21292781b52fa8c3ff64ba88856de1ff7a5b3433
|
|
BLAKE2b-256 checksum How to use checksums |
a24df6e1a20317a4d80267162e454324f6249eeea9bdb28e96a15f2bda0709d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / python_ted-0.0.6-py2.py3-none-any.whl
| Download URL | python_ted-0.0.6-py2.py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5104bf990cd88ca855150749bb6b532b25cffb6c8e11bd53703320c91319c26a
|
|
BLAKE2b-256 checksum How to use checksums |
27be61705572868049780dd6fe26be22cf4f9c11f35d793cf00a8a9506282649
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |