Skip to main content

Get live stream metadata from the various Australian parliaments.

Project description

legistream_backend

This is the Python backend for legistream.


Install with pip:

pip install legistream-backend

View project on PyPI: https://pypi-hypernode.com/project/legistream-backend/.

Usage

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
  • South Australia
  • Tasmania
  • Victoria
  • Western Australia

Setup

  1. Install poetry:

    pip3 install poetry
    
  2. Install/update dependencies with poetry:

    poetry update
    

Install ffmpeg:

Linux

sudo apt install ffmpeg

Mac

Install with brew:

brew install ffmpeg

Windows

Official Windows builds of ffmpeg can be found here

Print out stream URLs:

Every parliament module returns data the same way, Victoria is used here only for example purposes.

The stream_urls property can be used to return streams as a dict:

from legistream_backend.vic import Stream

print(Stream().stream_urls)

Each URL can be returned individually by using the [house]_stream_url property (e.g lower_stream_url)

print(Stream().lower_stream_url)

Check if a parliament's house is live:

Similarly, you can check the status of a live stream with the [house]_is_live boolean property.

if(Stream().lower_is_live):
    print('The lower house of Victoria is currently live.')
else:
    print('The lower house of Victoria is not currently live.')

Notes

  1. Run all scripts using poetry:

    poetry run python3 [file].py
    
  2. The South Australia stream extractor uses code adapted from the streamlink ustreamtv implementation.

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

legistream-backend-1.4.17-2.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

legistream_backend-1.4.17-2-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file legistream-backend-1.4.17-2.tar.gz.

File metadata

  • Download URL: legistream-backend-1.4.17-2.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for legistream-backend-1.4.17-2.tar.gz
Algorithm Hash digest
SHA256 ce7019bbea504c779e68a6c7015c28d101438e4c4b29fae154728f308a0e43e2
MD5 04455eece85352fe3bb20901c8ef1a28
BLAKE2b-256 3831f9fa5abce501849b2fec688d0d56e7001e1d949cdd2841c77aa501aa4920

See more details on using hashes here.

File details

Details for the file legistream_backend-1.4.17-2-py3-none-any.whl.

File metadata

  • Download URL: legistream_backend-1.4.17-2-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for legistream_backend-1.4.17-2-py3-none-any.whl
Algorithm Hash digest
SHA256 52929bd7eb85003602a05cab5a644489736685bb2b63d0320a99d9805c22f5a5
MD5 3cfeaf999e0def0d359ee85f8c6e73c3
BLAKE2b-256 06e0bc54ede3fb6b39aed63f31ef2bd09c0ebfcaf4936262c846d6f870d3ba44

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page