Roku-Scanner 1.0.4
Scans LAN for any connected Roku's and returns available device information.
Prerequisites
- Python3.8+
- PIP - should be installed with python, if not here
Installation
pip3 install roku-scanner
Usage
CLI
python3 -m roku_scanner
Options
Device data output in JSON.
python3 -m roku_scanner --json
Pretty print JSON. Can only be used with json flag.
python3 -m roku_scanner --json --pretty
Increasing timeout on discovery search time. Default is 2 secs. It's advised to use a time less than 10 secs.
python3 -m roku_scanner --timeout 5
Change search target to target all devices and not only Roku devices. This will result in non roku devices being added to discovery data. As now(1.0.4) only discovery data is returned for non Roku devices.
python3 -m roku_scanner --search-target-all
Verbose Logging
python3 -m roku_scanner --verbose
Excluding data from output.
python3 -m roku_scanner --exclude device-info
Exclusion Options
- device-info
- apps
- active-app
- media-player
Output Examples
Import Examples
Discovery and device data fetching
Discovering Roku's and fetching their device data.
from roku_scanner.scanner import Scanner
from roku_scanner.roku import Roku
scanner = Scanner()
scanner.discover()
found_devices = scanner.discovered_devices
for device in found_devices:
roku_location = device.get('LOCATION')
roku = Roku(location=roku_location, discovery_data=device)
roku.fetch_data()
detailed_device_data = roku.data
print(detailed_device_data)
JSON
Getting device data in JSON.
from roku_scanner.scanner import Scanner
from roku_scanner.roku import Roku
scanner = Scanner()
scanner.discover()
found_devices = scanner.discovered_devices
for device in found_devices:
roku_location = device.get('LOCATION')
roku = Roku(location=roku_location, discovery_data=device)
roku.fetch_data()
json_data = roku.as_json()
XML
Getting device data as XML.
from roku_scanner.scanner import Scanner
from roku_scanner.roku import Roku
scanner = Scanner()
scanner.discover()
found_devices = scanner.discovered_devices
for device in found_devices:
roku_location = device.get('LOCATION')
roku = Roku(location=roku_location, discovery_data=device)
roku.fetch_data()
xml_data = roku.as_xml()
Search Target in Scanner
Changes search target for scanner to search for all devices, this will return Roku devices and any other using UPnP
from roku_scanner.scanner import Scanner
scanner = Scanner(search_target='upnp:rootdevice')
scanner.discover()
all_types_of_devices = scanner.discovered_devices
Testing
pytest tests/
Code Standard
Roku-Scanner follows PEP 8 standard.
Versioning
Roku-Scanner uses SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Christian Cecilia - Initial work
See also the list of contributors who participated in this project.
Metadata
Release files for roku-scanner 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roku-scanner-1.0.4.tar.gz | 10.5 kB | Without provenance | Details for roku-scanner-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roku_scanner-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for roku_scanner-1.0.4-py3-none-any.whl |
Total release size: 21.7 kB
Release files / roku-scanner-1.0.4.tar.gz
| Download URL | roku-scanner-1.0.4.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62010b04a36fbf843fb6cfd7c6969fc4540a7dfd2c3fd4394c4a200433c0798d
|
|
BLAKE2b-256 checksum How to use checksums |
d018a5e2de62df61219e53332405e901fd0aac9ce7eaec8f606472f1d287a2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0
|
Release files / roku_scanner-1.0.4-py3-none-any.whl
| Download URL | roku_scanner-1.0.4-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e81d8ce8f719185778f42983f78b4bb4b4df10e86f1841a57e2aaf5e0ee2f32e
|
|
BLAKE2b-256 checksum How to use checksums |
ba21adb4c694c2ddad06b04d1515ef51737f39c75c1ca37f8cd152b09435fcc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0
|
Security for roku-scanner 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.