calliope.cli

Calliope command line interface.

This module provides the public command line interface for Calliope.

Module Contents

Classes

App

Functions

string_to_datetime(cal, string)

cli(context, verbosity)

Calliope is a set of tools for processing playlists.

bandcamp_cli(context, user)

cmd_bandcamp_collection(context)

Show all albums in the collection of the given Bandcamp user.

cmd_bandcamp_export_album(context, album_url)

Export tracks on a Bandcamp album as a playlist.

cmd_bandcamp_export_band(context, band_url, expand_albums)

Show albums published by a band or label.

cmd_bandcamp_wishlist(context)

Show all albums in the wishlist of the given Bandcamp user.

beets_cli(context)

cmd_beets_albums(context, include_tracks, query)

Show all albums available locally..

cmd_beets_artists(context, query)

Show artists stored in Beets database.

cmd_beets_tracks(context, query)

Show tracks stored in Beets database.

cmd_diff(context, scope, playlist1, playlist2)

cmd_export(context, format_, title, playlist)

Convert to a different playlist format

cmd_export_split(context, format_, stream, output_path)

Export multiple playlists from a stream based on playlist.title.

cmd_import(context, playlist)

Import playlists from other formats

lastfm_cli(context, user)

lastfm_annotate_tags(context, playlist)

Annotate playlist with tags from Last.fm

cmd_lastfm_similar_artists(context, count, artist)

Return similar artists for a given artist name.

cmd_lastfm_similar_tracks(context, count, artist, track)

Return similar tracks for a given track.

cmd_lastfm_top_artists(context, count, time_range, include)

Return user's top artists.

lastfm_history_cli(context, sync, user, server, ...)

cmd_lastfm_history_annotate(context, playlist)

cmd_lastfm_history_artists(context, first_play_before, ...)

cmd_lastfm_history_histogram(context, bucket)

Export a histogram of listens.

cmd_lastfm_history_listens(context)

cmd_lastfm_history_scrobbles(context)

cmd_lastfm_history_tracks(context, first_play_before, ...)

listenbrainz_cli(context, user)

cmd_listenbrainz_export(context, kind)

Export playlists from Listenbrainz.

listenbrainz_history_cli(context, sync, user)

cmd_listenbrainz_history_annotate(context, playlist)

cmd_listenbrainz_history_artists(context, ...)

cmd_listenbrainz_history_histogram(context, bucket)

Export a histogram of listens.

cmd_listenbrainz_history_listens(context)

Export individual listens as a playlist

cmd_listenbrainz_history_tracks(context, ...)

musicbrainz_cli(context)

cmd_musicbrainz_annotate(context, playlist, output, ...)

Annotate playlists with data from Musicbrainz

cmd_musicbrainz_list_includes(context)

List all possible values for --include option.

cmd_musicbrainz_resolve_image(context, playlist, max_size)

Resolve the 'image' property using the Cover Art API.

cmd_play(context, output, playlist)

Render a Calliope playlist to an audio file

cmd_select(context, constraints_list, playlist)

Select tracks from input playlist following a set of constraints.

cmd_shuffle(context, count, playlist)

Shuffle a playlist or collection.

spotify_cli(context)

cmd_spotify_export(context, library)

Query Spotify authenticated user's playlists

cmd_spotify_import(context, playlist, library)

Upload one or more playlists to Spotify as authenticated user

cmd_spotify_resolve(context, playlist, output, update, ...)

Add Spotify-specific information to tracks in a playlist.

cmd_spotify_top_artists(context, count, time_range)

Return authenticated user's top artists.

cmd_stat(context, size, playlist)

Information about the contents of a playlist

suggest_cli(context)

cmd_suggest_tracks(context, from_, count, training_input)

Suggest tracks from a collection based on the given training inputs.

cmd_sync(context, dry_run, target, allow_formats, ...)

Copy playlists & collections between devices

tracker_cli(context, http_endpoint)

cmd_tracker_annotate_images(context, playlist)

Add images from the local media-art cache.

cmd_tracker_expand_tracks(context, playlist)

Convert any 'artist' or 'album' type playlist items into 'track' items

cmd_tracker_albums(context, artist, include_tracks)

Show all albums available locally.

cmd_tracker_artists(context)

Show all artists whose music is available locally.

cmd_tracker_tracks(context)

Show all tracks available locally.

cmd_tracker_resolve_content(context, playlist)

Resolve the 'location' field using Tracker, if possible.

cmd_tracker_resolve_image(context, playlist)

Resolve 'image' property using the local media-art cache.

cmd_tracker_search(context, text)

Search for tracks in the Tracker database matching 'text'.

cmd_tracker_top_artists(context, count)

Query the top artists in a Tracker database

cmd_validate(context, playlist)

Validate a Calliope playlist stream.

youtube_cli(context, client_secrets)

cmd_youtube_export(context, username)

Query user playlists from Youtube

Attributes

DOC_URL

EXPORT_FORMATS

calliope.cli.DOC_URL = https://calliope-music.readthedocs.io/en/latest
class calliope.cli.App(verbosity=logging.WARNING)
calliope.cli.string_to_datetime(cal, string)
calliope.cli.cli(context, verbosity)

Calliope is a set of tools for processing playlists.

calliope.cli.bandcamp_cli(context, user)
calliope.cli.cmd_bandcamp_collection(context)

Show all albums in the collection of the given Bandcamp user.

Uses internal Bandcamp API calls.

calliope.cli.cmd_bandcamp_export_album(context, album_url)

Export tracks on a Bandcamp album as a playlist.

Uses web-scraping to get album ID and internal Bandcamp API calls to get the album info.

calliope.cli.cmd_bandcamp_export_band(context, band_url, expand_albums)

Show albums published by a band or label.

Uses web-scraping to get the data, so results may be unreliable.

calliope.cli.cmd_bandcamp_wishlist(context)

Show all albums in the wishlist of the given Bandcamp user.

Uses internal Bandcamp API calls.

calliope.cli.beets_cli(context)
calliope.cli.cmd_beets_albums(context, include_tracks, query)

Show all albums available locally..

calliope.cli.cmd_beets_artists(context, query)

Show artists stored in Beets database.

calliope.cli.cmd_beets_tracks(context, query)

Show tracks stored in Beets database.

calliope.cli.cmd_diff(context, scope, playlist1, playlist2)
calliope.cli.EXPORT_FORMATS = ['cue', 'm3u', 'jspf', 'xspf']
calliope.cli.cmd_export(context, format_, title, playlist)

Convert to a different playlist format

calliope.cli.cmd_export_split(context, format_, stream, output_path)

Export multiple playlists from a stream based on playlist.title.

calliope.cli.cmd_import(context, playlist)

Import playlists from other formats

Supported formats:

  • pls: Common INI-based playlist format

  • xspf: The XML Shareable Playlist Format

  • jspf: JSON variant of xspf

calliope.cli.lastfm_cli(context, user)
calliope.cli.lastfm_annotate_tags(context, playlist)

Annotate playlist with tags from Last.fm

calliope.cli.cmd_lastfm_similar_artists(context, count, artist)

Return similar artists for a given artist name.

calliope.cli.cmd_lastfm_similar_tracks(context, count, artist, track)

Return similar tracks for a given track.

calliope.cli.cmd_lastfm_top_artists(context, count, time_range, include)

Return user’s top artists.

calliope.cli.lastfm_history_cli(context, sync, user, server, retry_on_error)
calliope.cli.cmd_lastfm_history_annotate(context, playlist)
calliope.cli.cmd_lastfm_history_artists(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since)
calliope.cli.cmd_lastfm_history_histogram(context, bucket)

Export a histogram of listens.

calliope.cli.cmd_lastfm_history_listens(context)
calliope.cli.cmd_lastfm_history_scrobbles(context)
calliope.cli.cmd_lastfm_history_tracks(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since)
calliope.cli.listenbrainz_cli(context, user)
calliope.cli.cmd_listenbrainz_export(context, kind)

Export playlists from Listenbrainz.

calliope.cli.listenbrainz_history_cli(context, sync, user)
calliope.cli.cmd_listenbrainz_history_annotate(context, playlist)
calliope.cli.cmd_listenbrainz_history_artists(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since)
calliope.cli.cmd_listenbrainz_history_histogram(context, bucket)

Export a histogram of listens.

calliope.cli.cmd_listenbrainz_history_listens(context)

Export individual listens as a playlist

calliope.cli.cmd_listenbrainz_history_tracks(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since)
calliope.cli.musicbrainz_cli(context)
calliope.cli.cmd_musicbrainz_annotate(context, playlist, output, include, update, interactive)

Annotate playlists with data from Musicbrainz

calliope.cli.cmd_musicbrainz_list_includes(context)

List all possible values for –include option.

calliope.cli.cmd_musicbrainz_resolve_image(context, playlist, max_size)

Resolve the ‘image’ property using the Cover Art API.

calliope.cli.cmd_play(context, output, playlist)

Render a Calliope playlist to an audio file

calliope.cli.cmd_select(context, constraints_list, playlist)

Select tracks from input playlist following a set of constraints.

Each constraint is defined by a key/value string. Here are some examples:


  • –constraint=type:playlist-duration,vmin:60m,vmax:120m

  • –constraint=type:fraction-global,prop:tags,values:rock;punk,fraction:0.5

calliope.cli.cmd_shuffle(context, count, playlist)

Shuffle a playlist or collection.

calliope.cli.spotify_cli(context)
calliope.cli.cmd_spotify_export(context, library)

Query Spotify authenticated user’s playlists

calliope.cli.cmd_spotify_import(context, playlist, library)

Upload one or more playlists to Spotify as authenticated user

calliope.cli.cmd_spotify_resolve(context, playlist, output, update, interactive)

Add Spotify-specific information to tracks in a playlist.

calliope.cli.cmd_spotify_top_artists(context, count, time_range)

Return authenticated user’s top artists.

calliope.cli.cmd_stat(context, size, playlist)

Information about the contents of a playlist

calliope.cli.suggest_cli(context)
calliope.cli.cmd_suggest_tracks(context, from_, count, training_input)

Suggest tracks from a collection based on the given training inputs.

calliope.cli.cmd_sync(context, dry_run, target, allow_formats, album_per_dir, number_dirs, number_files, playlist)

Copy playlists & collections between devices

calliope.cli.tracker_cli(context, http_endpoint)
calliope.cli.cmd_tracker_annotate_images(context, playlist)

Add images from the local media-art cache.

calliope.cli.cmd_tracker_expand_tracks(context, playlist)

Convert any ‘artist’ or ‘album’ type playlist items into ‘track’ items

calliope.cli.cmd_tracker_albums(context, artist, include_tracks)

Show all albums available locally.

calliope.cli.cmd_tracker_artists(context)

Show all artists whose music is available locally.

calliope.cli.cmd_tracker_tracks(context)

Show all tracks available locally.

calliope.cli.cmd_tracker_resolve_content(context, playlist)

Resolve the ‘location’ field using Tracker, if possible.

calliope.cli.cmd_tracker_resolve_image(context, playlist)

Resolve ‘image’ property using the local media-art cache.

Search for tracks in the Tracker database matching ‘text’.

Append ‘*’ to enable partial matching of a search term.

calliope.cli.cmd_tracker_top_artists(context, count)

Query the top artists in a Tracker database

calliope.cli.cmd_validate(context, playlist)

Validate a Calliope playlist stream.

calliope.cli.youtube_cli(context, client_secrets)
calliope.cli.cmd_youtube_export(context, username)

Query user playlists from Youtube