Skip to main content

CLI tool to check what's playing on NTS Radio

Project description

NTS Radio CLI

A command-line interface to check what's playing on NTS Radio.

Installation

From PyPI:

pip install nts-radio-cli

Or if using uv:

uv pip install nts-radio-cli

For local development with uv:

# Install in editable mode
uv pip install -e .

# Run the CLI
uv run nts-radio now
# or
uv run nts-radio schedule

Usage

Once installed from PyPI, you can use these commands:

Check Currently Playing Shows

nts-radio now

To include show artwork (displayed in ASCII art):

nts-radio now --art

You can customize the size of the artwork using the --art-width and --art-height options:

# Default size (80x40)
nts-radio now --art

# Custom size (100x50)
nts-radio now --art --art-width 100 --art-height 50

# Smaller size (40x20)
nts-radio now --art --art-width 40 --art-height 20

View Full Schedule

nts-radio schedule

Get Raw JSON Data

nts-radio json

This command outputs the raw JSON data from the NTS API, which can be useful for debugging or piping to other tools.

View NTS Information and Stream URLs

nts-radio info

This command displays general information about NTS, including stream URLs for both channels.

Get Stream URL

nts-radio stream-url <channel>

Get just the stream URL for a specific channel (1 or 2). Useful for piping to other applications.

Examples:

# Get channel 1 stream URL
nts-radio stream-url 1

# Get channel 2 stream URL
nts-radio stream-url 2

# Example: Play channel 1 in mpv
nts-radio stream-url 1 | xargs mpv

# Example: Play channel 2 in VLC
nts-radio stream-url 2 | xargs vlc

Features

  • Display currently playing shows on both NTS channels
  • Show upcoming broadcasts
  • View full schedule for both channels
  • Optional ASCII art display of show artwork with customizable dimensions
  • Access raw JSON data from the NTS API
  • View stream URLs and general NTS Radio information
  • Option to disable colored output

Disable Colors

You can disable colored output using the --no-color option:

nts-radio --no-color json

Requirements

  • Python 3.8 or higher

Testing

To run the tests:

# Install test dependencies
uv sync --group dev

# Run tests
uv run pytest

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

nts_radio_cli-0.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nts_radio_cli-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file nts_radio_cli-0.2.0.tar.gz.

File metadata

  • Download URL: nts_radio_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.1

File hashes

Hashes for nts_radio_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 df02054e70af6765b475ed7266bf244015d17a17e9551de4db19007f26695291
MD5 840b70e4a79a52beab4d65352983677e
BLAKE2b-256 882751bbc12a1e668601803e689009b84163e7fe1568ea31d2db32107616dde7

See more details on using hashes here.

File details

Details for the file nts_radio_cli-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nts_radio_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a18aef44e1f01cda29a5377264d4efa26f7dac0671d47507b2cfa1f781478aa
MD5 e9e02ce068e38bdd56307d6b94d5cafc
BLAKE2b-256 767d0f64c1cc5f2871b20af17ee5ac6fd1b3c4a3029bdfd23eb922a6508361e1

See more details on using hashes here.

Supported by

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