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
                                 XDG_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.0.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metalfinder-2.0.0-py2.py3-none-any.whl (23.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for metalfinder-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c943487f5d9ddafe7be9fc3b922967c75dde7fa739a642c8c46ee09cd172d7df
MD5 a727eef00d2073ba11dc6eb49a8398f1
BLAKE2b-256 e3dd5b25d4518cac018592d3b3a917f58c9a25a57c885218c3e07f6d04af7d94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: metalfinder-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for metalfinder-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f1a7a55cbf3bfa0d924ea0dc058f2b6ed93fcd777761f62e0c2c2d03ad6ff892
MD5 bb2fe5c601ab251512afb1c9df10d69a
BLAKE2b-256 164ca0624ab7ccf3265802bd0bc780321c62a7e909194c0d1a035ebc65c5ca5e

See more details on using hashes here.

Supported by

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