Skip to main content
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

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.6.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_ted-0.0.6-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file python-ted-0.0.6.tar.gz.

File metadata

  • Download URL: python-ted-0.0.6.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-ted-0.0.6.tar.gz
Algorithm Hash digest
SHA256 2f083347869486999a1e559e21292781b52fa8c3ff64ba88856de1ff7a5b3433
MD5 0f6acd57016e3875ddde864f2fb214b5
BLAKE2b-256 a24df6e1a20317a4d80267162e454324f6249eeea9bdb28e96a15f2bda0709d9

See more details on using hashes here.

File details

Details for the file python_ted-0.0.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_ted-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5104bf990cd88ca855150749bb6b532b25cffb6c8e11bd53703320c91319c26a
MD5 30539930d4418ea47bc86d8b8193312d
BLAKE2b-256 27be61705572868049780dd6fe26be22cf4f9c11f35d793cf00a8a9506282649

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page