Skip to main content

scan a music directory to find concerts near a specified location

Project description

metalfinder is a command-line tool that scans a music directory to find concerts near a specified location.

Installation

Using pip

You can install metalfinder using pip:

$ pip install metalfinder

From source

You can install metalfinder from source using flit:

$ apt install flit
$ git clone https://gitlab.com/baldurmen/metalfinder
$ cd metafinder
$ flit install

Run without installing

If you already have all the required dependencies, you can run metalfinder directly from the source without installing it:

$ python3 -m metalfinder

API Providers

Bandsintown

To use the Bandsintown API provider, you will need a Bandsintown App ID. This is your API key and it should be kept private.

Other providers

Do you know a good website that tracks concerts and has a somewhat public API? If keys are not too hard to get, I’d be more than happy to implement it!

CLI options

Here is an example of how to use metalfinder:

$ export METALFINDER_BIT_APPID=mysecretapikey
$ metalfinder -d "/home/foo/Music" -o "/home/foo/metalfinder.atom" -l "Montreal"

The complete CLI parameters can be found below and in the man page:

Usage:
    metalfinder [-d <directory>] -o <output> -l <location> -b <app_id> [-c <cache>] [-m <date>] [--verbose]
    metalfinder (-h | --help)
    metalfinder --version

Options:
    -h  --help                   Show the help screen
    --version                    Output version information
    --verbose                    Run the program in verbose mode
    -d  --directory <directory>  Music directory to scan to create artist list
    -o  --output    <output>     Path to the desired output file. You can either
                                 chose a text file (foo.txt), a JSON file (foo.json)
                                 or an ATOM file (foo.atom)
    -l  --location  <location>   Name of the city to use when looking for concerts
    -b  --bit-appid <app_id>     Bandsintown App ID (API key). Optional when the
                                 METALFINDER_BIT_APPID environment variable is set.
    -c  --cache-dir <cache_dir>  Path to the cache directory. Defaults to
                                 $HOME/.cache/metalfinder/
    -m  --max-date  <date>       Max date in YYYY-MM-DD format (ISO 8601)

Environment Variables

metalfinder uses the following environment variables:

METALFINDER_BIT_APPID: Bandsintown API key. Useful to keep your API key from leaking when running metalfinder on the command line.

Running without a local directory

Even though metalfinder defaults to scanning a local directory to create a list of artists, it is possible to use an existing artist list created by some other program.

Using a subsonic server

This feature has not yet been implemented. See issue #15.

Using an MDP server

Since the --directory option is optional, if it is missing, only the cache directory will be inspected. In this directory, metalfinder looks for a file named artist_cache which consists of a list of artist names separated by new lines.

If you have an MPD server, you can generate this file with the help of the mpc client:

$ mpc list Artist > ~/.cache/metalfinder/artist_cache

Development

Running the test suite

You can run the test suite locally using pip and pytest:

$ python3 -m venv metalfinder
$ cd metalfinder
$ source bin/activate
$ git clone https://gitlab.com/baldurmen/metalfinder
$ cd metafinder
$ python3 -m pip install .[test]
$ python3 -m pytest

Building the man page

The man page for metalfinder can be generated using the rst2man command line tool provided by the docutils project:

$ rst2man manpage.rst metalfinder.1

License

This project was written by Louis-Philippe Véronneau and is licensed under the GNU GPLv3 or any later version.

The code to query Bandsintown comes from the python-bandsintown project, was written by Chris Forrette and is licensed under the MIT license.

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

metalfinder-2.1.4.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

metalfinder-2.1.4-py2.py3-none-any.whl (23.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file metalfinder-2.1.4.tar.gz.

File metadata

  • Download URL: metalfinder-2.1.4.tar.gz
  • Upload date:
  • Size: 28.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for metalfinder-2.1.4.tar.gz
Algorithm Hash digest
SHA256 45e5dae03da29c3f6d35ce4138a97a345f6cb507289664b369b6e8306a1f4c08
MD5 0a9916262ec1f21cc12451cf790161a8
BLAKE2b-256 f97380fcd2a8c98373e0b1bb32ed749f6c69c0889231e268cea91dd9668c2833

See more details on using hashes here.

File details

Details for the file metalfinder-2.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for metalfinder-2.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8461db0215cae9c4e84258a5ad27ee6c76d06965b92d054045ee1414c5e09409
MD5 16354a3486ec59077c17423786511b09
BLAKE2b-256 41bb202279b2169025d22cc6f5facd13d842a55eefd097ec95915189f8a202d8

See more details on using hashes here.

Supported by

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