This is the Python backend for Legistream.
Install with pip3
:
pip3 install legistream-backend
View project on PyPI: https://pypi.org/project/legistream-backend/.
This package uses different modules to get live stream data from the various Australian parliaments.
Currently supported parliaments:
- Australian Capital Territory
- Federal
- New South Wales
- Northern Territory
- Queensland
-
Install
poetry
:pip3 install poetry
-
Install/update dependencies with
poetry
:poetry update
-
Install ffmpeg:
sudo apt install ffmpeg
Install with brew:
brew install ffmpeg
Official Windows builds of ffmpeg can be found here
Every parliament module returns data as a list of StreamModel
objects. Each StreamModel
has these 3 properties:
- Stream URL:
string
- Stream title:
string
- Stream status (is this stream live?):
bool
- Stream thumbnail URL (for use in conjuction with legistream-site)
Note: The ACT is used here just as an example, this works for all the parliament modules.
from legistream_backend.site.act import ACTStreamExtractor
for stream in ACTStreamExtractor().streams:
print(stream.url,
stream.title,
stream.is_live
)
-
Run all scripts using
poetry
:poetry run python3 <file>.py
-
The South Australia stream extractor uses code adapted from the streamlink ustreamtv implementation.