Skip to main content

guestrrday

because for music heads, context matters!

A CLI tool that does one thing and does it well: guess the release date and record label of a set of music tracks with high accuracy and precision. 20,000+ songs guessed so far!

Description

The pop music historian's dream: given a directory of music tracks or a list of one or more song names (in a textfile or CLI args), guess the year of release and the record label of each track.

Example:

Ike & Tina Turner - A Love Like Yours (Don't Come Knocking Everyday)

=>

Ike & Tina Turner - A Love Like Yours (Don't Come Knocking Everyday) (London American, 1966)

The script queries discogs.com and includes some tweaks to increase the precision and accuracy of the search (see Why This Tool? below).

The tool will rename files if the input is a directory, and will create a new textfile in the case of file, and will print to stdout in case of cli args.

Installation

  • guesterrday can be installed by running pip install guestrrday.
  • To update guesterrday run pip install --upgrade guestrrday.

On some systems you might have to change pip to pip3.

Usage

NOTE: You need to have a free discogs user token to use the tool. This is how to do it:

  1. Create a free account on discogs.com
  2. Visit the developer tools section and create a new token
  3. Set the DISCOGS_TOKEN environmental variable on your system with that value. Alternatively, the tool will prompt you for it on the first run and then store in an environmental variable.

General Usage:

guestrrday --input SOURCE

Where SOURCE can be any of:

  • Directory containing music files, or
  • Filename for a text file containing a list song names, one per line, or
  • "[song1] [, song2 ] [...]": Comma-separated list of song names

The tool will automatically detect which one you mean.

You can run guestrrday as a package if running it as a script doesn't work:

python -m guestrrday --input SOURCE

Why This Tool?

TLDR; The devil in the detail

Guestrrday scans a list of song titles and queries discogs.com for the year and label of each. This is clearly a simple function, right? Why a whole tool?

I made this tool because I had two strict requirements: high prediction rate and accuracy at scale. So what is the current prediction rate and accuracy you ask? Well, there are three variables affecting prediction rate and accuracy: (1) the completeness of the discogs.com database, (2) unsanitized tracknames / filenames, and (3) the limitations of the discogs search engine (ex., sensitivity to slight changes in search terms). We can't control (1) but we can control (2) & (3), and this is what this tool focuses on1. The completeness of the discogs DB and any music DB really varies based on the music: for example, data on 90s electronic music singles is much more complete than pre-war blues releases (1930s, 40s).

To throw rough estimates from experience, I would say the average completness of the discogs DB with regards to the year of release is around 85-90%. 95% of those are typically detected by this tool, which gives it a 95% prediction rate.

However, it must be noted, there are many singles on discogs which have no original year of release, in that case the tool will return the year of release of the earliest available reissue. For example, a disco single released in 1970s but for which no year is available for the original release, but a reissue exists (say, one released in 2015), the detected year for that track would be 2015 (and the label would be the reissue label).

Contribution

Pull requests welcome, just create an issue.

License

This project is Licensed under the MIT License.

  1. I tried generic fuzzy matching (thefuzz) but couldn't seem to get as good of an accuracy in search results: I got more false positives and couldn't find a sweetspot in the numerical score to optimize false negatives. Ofcourse I could have run a large test sets and optimized for that value and fuzzy matching algorithm, but for such a small project it was not worth it. ↩

Metadata

Release files for guestrrday 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for guestrrday 0.1.2
File Size Uploaded Provenance Actions
guestrrday-0.1.2.tar.gz 16.3 kB Without provenance Details for guestrrday-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for guestrrday 0.1.2
File Interpreter ABI Platform Actions
guestrrday-0.1.2-py3-none-any.whl Python 3 none any Details for guestrrday-0.1.2-py3-none-any.whl

Total release size: 32.8 kB

Release files / guestrrday-0.1.2.tar.gz

Download URL guestrrday-0.1.2.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ac5816d8046478dfcaa4f4149e28a0e1ba60b91e4ff4e24764bd0beef11b4ed2
BLAKE2b-256 checksum
How to use checksums
246405828e82199f353013296761267fcae08a4b6857625bb675b080eb10c0fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

Release files / guestrrday-0.1.2-py3-none-any.whl

Download URL guestrrday-0.1.2-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49da7e8a8fcb47653d42a6799984d7df36a4f53307ac49dd87b281a862706791
BLAKE2b-256 checksum
How to use checksums
3c9724e606b7b93741099a1be672fdc0090e1cec8a3540892d956d080e4f6f7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2

Security for guestrrday 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page