A Python wrapper for the http://www.radio-browser.info/webservice
Project description
Pyradios
A Python wrapper for the Radio Browser
Installation
pip install pyradios
Usage example
In [1]: from pyradios import RadioBrowser
In [2]: rb = RadioBrowser()
In [3]: rb.search(name="BBC Radio 1", name_exact=True)
Out[3]:
[{'changeuuid': '4f7e4097-4354-11e8-b74d-52543be04c81',
'stationuuid': '96062a7b-0601-11e8-ae97-52543be04c81',
'name': 'BBC Radio 1',
'url': 'http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p',
'url_resolved': 'http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p',
'homepage': 'http://www.bbc.co.uk/radio1/',
'favicon': 'https://cdn-radiotime-logos.tunein.com/s24939q.png',
'tags': 'bbc,indie,entertainment,music,rock,pop',
'country': 'United Kingdom',
'countrycode': 'GB',
'state': '',
'language': 'english',
'votes': 5018,
'lastchangetime': '2020-01-19 13:17:11',
'codec': 'MP3',
'bitrate': 128,
'hls': 0,
'lastcheckok': 1,
'lastchecktime': '2020-02-03 19:44:37',
'lastcheckoktime': '2020-02-03 19:44:37',
'lastlocalchecktime': '2020-02-03 09:23:37',
'clicktimestamp': '2020-02-04 00:16:54',
'clickcount': 2880,
'clicktrend': 40}]
In [4]: rb.station_by_uuid('96062a7b-0601-11e8-ae97-52543be04c81')
Out[4]:
[{'changeuuid': '4f7e4097-4354-11e8-b74d-52543be04c81',
'stationuuid': '96062a7b-0601-11e8-ae97-52543be04c81',
'name': 'BBC Radio 1',
'url': 'http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p',
'url_resolved': 'http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p',
'homepage': 'http://www.bbc.co.uk/radio1/',
'favicon': 'https://cdn-radiotime-logos.tunein.com/s24939q.png',
'tags': 'bbc,indie,entertainment,music,rock,pop',
'country': 'United Kingdom',
'countrycode': 'GB',
'state': '',
'language': 'english',
'votes': 5018,
'lastchangetime': '2020-01-19 13:00:12',
'codec': 'MP3',
'bitrate': 128,
'hls': 0,
'lastcheckok': 1,
'lastchecktime': '2020-02-07 10:12:45',
'lastcheckoktime': '2020-02-07 10:12:45',
'lastlocalchecktime': '2020-02-07 10:12:45',
'clicktimestamp': '2020-02-07 17:44:54',
'clickcount': 3343,
'clicktrend': 5}]
Help
In [1]: from pyradios import RadioBrowser
In [2]: rb = RadioBrowser()
In [3]: help(rb)
Development Setup
$ git clone https://github.com/andreztz/pyradios.git
$ cd pyradios
$ virtualenv venv
$ source venv/bin/activate
$ python setup.py develop
$ pip install pytest
$ pip install responses
Run Tests
$ pytest
Release History
- Work in progress
Meta
Andre P. Santos – @ztzandre – andreztz@gmail.com
Distributed under the MIT LICENSE. See LICENSE
for more information.
Contributing
- Fork it (https://github.com/andreztz/pyradios/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyradios-0.0.21.tar.gz
(9.9 kB
view hashes)
Built Distribution
pyradios-0.0.21-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for pyradios-0.0.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5be932551383d6d16390bbdb8ac8ad4b6e96feb640e77b816f99b09dd9e2e032 |
|
MD5 | 0d7db1c7c68af5e1d1863e5ed8ffc4c9 |
|
BLAKE2b-256 | 9a21db4dc1d2c639abbae0e32c02e879dbeef12d35af97a17cfc6ddb9135b37a |