Implements an unofficial API client in Python and provides an example command-line client for processing BBC Radio station programme schedules.
Install with pip
or poetry
, e.g.
pip install git+https://github.com/StevenMaude/bbc-radio-schedules
(or use pip install git+git
… in the command above).
There are four main classes. These are constructed with very little input, since the data is retrieved from the BBC site.
Stations
- Construct via
bbcradio.Stations()
.
- Construct via
Station
- The
Stations()
.select()
method constructs aStation()
, by passing in the name of a station found inStations()
.
- The
Schedule
- Construct via
bbcradio.Schedule()
, passing in aStation()
and a date as a string in the "YYYY-MM-DD" format.
- Construct via
Programme
- Used to store details for a programme; a
Schedule()
contains a list ofProgramme()
- Used to store details for a programme; a
See the CLI client for an example.
After installing the package, run with bbcradio_cli
:
> bbcradio_cli -h # show help
> bbcradio_cli stations # list stations
> bbcradio_cli schedule "BBC Radio 1" "2020-01-27" # display schedule