spotify_actions/examples/find_albums.py

27 lines
656 B
Python
Raw Normal View History

2021-07-03 19:29:50 -04:00
"""
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
2021-07-03 19:29:50 -04:00
parser = ArgumentParser()
parser.add_argument("-f", "--config", required=True)
parser.add_argument("search_string")
cmdline = parser.parse_args()
client = read_credentials(cmdline.config)
2021-07-03 19:29:50 -04:00
albums = search_album(client, cmdline.search_string)
echo_album(albums)
2021-07-03 19:29:50 -04:00
if __name__ == "__main__":
main()