:py:mod:`calliope.cli` ====================== .. py:module:: calliope.cli .. autoapi-nested-parse:: Calliope command line interface. This module provides the public command line interface for Calliope. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: calliope.cli.App Functions ~~~~~~~~~ .. autoapisummary:: calliope.cli.string_to_datetime calliope.cli.cli calliope.cli.bandcamp_cli calliope.cli.cmd_bandcamp_collection calliope.cli.cmd_bandcamp_export_album calliope.cli.cmd_bandcamp_export_band calliope.cli.cmd_bandcamp_wishlist calliope.cli.beets_cli calliope.cli.cmd_beets_albums calliope.cli.cmd_beets_artists calliope.cli.cmd_beets_tracks calliope.cli.cmd_diff calliope.cli.cmd_export calliope.cli.cmd_export_split calliope.cli.cmd_import calliope.cli.lastfm_cli calliope.cli.lastfm_annotate_tags calliope.cli.cmd_lastfm_similar_artists calliope.cli.cmd_lastfm_similar_tracks calliope.cli.cmd_lastfm_top_artists calliope.cli.lastfm_history_cli calliope.cli.cmd_lastfm_history_annotate calliope.cli.cmd_lastfm_history_artists calliope.cli.cmd_lastfm_history_histogram calliope.cli.cmd_lastfm_history_listens calliope.cli.cmd_lastfm_history_scrobbles calliope.cli.cmd_lastfm_history_tracks calliope.cli.listenbrainz_cli calliope.cli.cmd_listenbrainz_export calliope.cli.listenbrainz_history_cli calliope.cli.cmd_listenbrainz_history_annotate calliope.cli.cmd_listenbrainz_history_artists calliope.cli.cmd_listenbrainz_history_histogram calliope.cli.cmd_listenbrainz_history_listens calliope.cli.cmd_listenbrainz_history_tracks calliope.cli.musicbrainz_cli calliope.cli.cmd_musicbrainz_annotate calliope.cli.cmd_musicbrainz_list_includes calliope.cli.cmd_musicbrainz_resolve_image calliope.cli.cmd_play calliope.cli.cmd_select calliope.cli.cmd_shuffle calliope.cli.spotify_cli calliope.cli.cmd_spotify_export calliope.cli.cmd_spotify_import calliope.cli.cmd_spotify_resolve calliope.cli.cmd_spotify_top_artists calliope.cli.cmd_stat calliope.cli.suggest_cli calliope.cli.cmd_suggest_tracks calliope.cli.cmd_sync calliope.cli.tracker_cli calliope.cli.cmd_tracker_annotate_images calliope.cli.cmd_tracker_expand_tracks calliope.cli.cmd_tracker_albums calliope.cli.cmd_tracker_artists calliope.cli.cmd_tracker_tracks calliope.cli.cmd_tracker_resolve_content calliope.cli.cmd_tracker_resolve_image calliope.cli.cmd_tracker_search calliope.cli.cmd_tracker_top_artists calliope.cli.cmd_validate calliope.cli.youtube_cli calliope.cli.cmd_youtube_export Attributes ~~~~~~~~~~ .. autoapisummary:: calliope.cli.DOC_URL calliope.cli.EXPORT_FORMATS .. py:data:: DOC_URL :annotation: = https://calliope-music.readthedocs.io/en/latest .. py:class:: App(verbosity=logging.WARNING) .. py:function:: string_to_datetime(cal, string) .. py:function:: cli(context, verbosity) Calliope is a set of tools for processing playlists. .. py:function:: bandcamp_cli(context, user) .. py:function:: cmd_bandcamp_collection(context) Show all albums in the collection of the given Bandcamp user. Uses internal Bandcamp API calls. .. py:function:: 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. .. py:function:: 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. .. py:function:: cmd_bandcamp_wishlist(context) Show all albums in the wishlist of the given Bandcamp user. Uses internal Bandcamp API calls. .. py:function:: beets_cli(context) .. py:function:: cmd_beets_albums(context, include_tracks, query) Show all albums available locally.. .. py:function:: cmd_beets_artists(context, query) Show artists stored in Beets database. .. py:function:: cmd_beets_tracks(context, query) Show tracks stored in Beets database. .. py:function:: cmd_diff(context, scope, playlist1, playlist2) .. py:data:: EXPORT_FORMATS :annotation: = ['cue', 'm3u', 'jspf', 'xspf'] .. py:function:: cmd_export(context, format_, title, playlist) Convert to a different playlist format .. py:function:: cmd_export_split(context, format_, stream, output_path) Export multiple playlists from a stream based on `playlist.title`. .. py:function:: 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 .. py:function:: lastfm_cli(context, user) .. py:function:: lastfm_annotate_tags(context, playlist) Annotate playlist with tags from Last.fm .. py:function:: cmd_lastfm_similar_artists(context, count, artist) Return similar artists for a given artist name. .. py:function:: cmd_lastfm_similar_tracks(context, count, artist, track) Return similar tracks for a given track. .. py:function:: cmd_lastfm_top_artists(context, count, time_range, include) Return user's top artists. .. py:function:: lastfm_history_cli(context, sync, user, server, retry_on_error) .. py:function:: cmd_lastfm_history_annotate(context, playlist) .. py:function:: cmd_lastfm_history_artists(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since) .. py:function:: cmd_lastfm_history_histogram(context, bucket) Export a histogram of listens. .. py:function:: cmd_lastfm_history_listens(context) .. py:function:: cmd_lastfm_history_scrobbles(context) .. py:function:: cmd_lastfm_history_tracks(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since) .. py:function:: listenbrainz_cli(context, user) .. py:function:: cmd_listenbrainz_export(context, kind) Export playlists from Listenbrainz. .. py:function:: listenbrainz_history_cli(context, sync, user) .. py:function:: cmd_listenbrainz_history_annotate(context, playlist) .. py:function:: cmd_listenbrainz_history_artists(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since) .. py:function:: cmd_listenbrainz_history_histogram(context, bucket) Export a histogram of listens. .. py:function:: cmd_listenbrainz_history_listens(context) Export individual listens as a playlist .. py:function:: cmd_listenbrainz_history_tracks(context, first_play_before, first_play_since, last_play_before, last_play_since, min_listens, show_listens_since) .. py:function:: musicbrainz_cli(context) .. py:function:: cmd_musicbrainz_annotate(context, playlist, output, include, update, interactive) Annotate playlists with data from Musicbrainz .. py:function:: cmd_musicbrainz_list_includes(context) List all possible values for `--include` option. .. py:function:: cmd_musicbrainz_resolve_image(context, playlist, max_size) Resolve the 'image' property using the Cover Art API. .. py:function:: cmd_play(context, output, playlist) Render a Calliope playlist to an audio file .. py:function:: 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 .. py:function:: cmd_shuffle(context, count, playlist) Shuffle a playlist or collection. .. py:function:: spotify_cli(context) .. py:function:: cmd_spotify_export(context, library) Query Spotify authenticated user's playlists .. py:function:: cmd_spotify_import(context, playlist, library) Upload one or more playlists to Spotify as authenticated user .. py:function:: cmd_spotify_resolve(context, playlist, output, update, interactive) Add Spotify-specific information to tracks in a playlist. .. py:function:: cmd_spotify_top_artists(context, count, time_range) Return authenticated user's top artists. .. py:function:: cmd_stat(context, size, playlist) Information about the contents of a playlist .. py:function:: suggest_cli(context) .. py:function:: cmd_suggest_tracks(context, from_, count, training_input) Suggest tracks from a collection based on the given training inputs. .. py:function:: cmd_sync(context, dry_run, target, allow_formats, album_per_dir, number_dirs, number_files, playlist) Copy playlists & collections between devices .. py:function:: tracker_cli(context, http_endpoint) .. py:function:: cmd_tracker_annotate_images(context, playlist) Add images from the local media-art cache. .. py:function:: cmd_tracker_expand_tracks(context, playlist) Convert any 'artist' or 'album' type playlist items into 'track' items .. py:function:: cmd_tracker_albums(context, artist, include_tracks) Show all albums available locally. .. py:function:: cmd_tracker_artists(context) Show all artists whose music is available locally. .. py:function:: cmd_tracker_tracks(context) Show all tracks available locally. .. py:function:: cmd_tracker_resolve_content(context, playlist) Resolve the 'location' field using Tracker, if possible. .. py:function:: cmd_tracker_resolve_image(context, playlist) Resolve 'image' property using the local media-art cache. .. py:function:: cmd_tracker_search(context, text) Search for tracks in the Tracker database matching 'text'. Append '*' to enable partial matching of a search term. .. py:function:: cmd_tracker_top_artists(context, count) Query the top artists in a Tracker database .. py:function:: cmd_validate(context, playlist) Validate a Calliope playlist stream. .. py:function:: youtube_cli(context, client_secrets) .. py:function:: cmd_youtube_export(context, username) Query user playlists from Youtube