spotify_actions/examples/find_albums.py
Bradlee Speice 9f5caa76f0 Fall back to using Spotipy
Would rather have async I/O, but there are too many issues with the data model of other APIs.
2021-07-03 22:46:30 -04:00

27 lines
656 B
Python
Executable File

"""
Find an album using the `spotify_actions` API and echo its contents.
"""
from argparse import ArgumentParser
from spotify_actions.echo import echo_album
from spotify_actions.search import search_album
from spotify_actions.util import read_credentials
def main() -> None: # pylint: disable=missing-function-docstring
parser = ArgumentParser()
parser.add_argument("-f", "--config", required=True)
parser.add_argument("search_string")
cmdline = parser.parse_args()
client = read_credentials(cmdline.config)
albums = search_album(client, cmdline.search_string)
echo_album(albums)
if __name__ == "__main__":
main()