SkillAgentSearch skills...

Phrydy

Extended version of the mediafile library of the beets project. It is used by the Python command line tool `audiorename`.

Install / Use

/learn @Josef-Friedrich/Phrydy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

.. image:: http://img.shields.io/pypi/v/phrydy.svg :target: https://pypi.org/project/phrydy :alt: This package on the Python Package Index

.. image:: https://github.com/Josef-Friedrich/phrydy/actions/workflows/tests.yml/badge.svg :target: https://github.com/Josef-Friedrich/phrydy/actions/workflows/tests.yml :alt: Tests

.. image:: https://readthedocs.org/projects/phrydy/badge/?version=latest :target: https://phrydy.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

====== phrydy

This is an extended version of the mediafile <https://github.com/beetbox/mediafile>_ library of the beets <https://beets.io>_ project. It is used by the Python audio renaming command line tool audiorename <https://github.com/Josef-Friedrich/audiorename>_.

The name phrydy is pronounced like the German word Friedi.

phrydy offeres two media file classes: MediaFile is the unmodified version that comes directly from the beets project. MediaFileExtended is the slightly modified and extended version:

Changed fields:

  • albumartist_sort: Uses TSO2 Uses MP3s’ storage style TSO2.
  • composer_sort: Uses MP3s’ description storage style composersortorder.
  • mb_workid: Uses the additional storage style musicbrainz work id.

New fields:

  • mb_workhierarchy_ids: All IDs in the work hierarchy.
  • work: The last work in the work hierarchy.
  • work_hierarchy: The hierarchy of works: The top level work appears first.
  • releasegroup_types: All items in the MusicBrainz’ API related to type: type, primary-type andsecondary-type-list.

Type hints:

phrydy provides type hints:

.. image:: https://raw.githubusercontent.com/Josef-Friedrich/phrydy/refs/heads/main/docs/Type-hints.gif :alt: Type-hints.gif

Other additions:

  • A little command line debug utility named phrydy-debug.
  • A dictionary containing documentation about the various meta data fields.
  • Some code to generate documentation from the field documentation dictionary.

Installation

From PyPI

.. code:: Shell

pip install phrydy

From Github

.. code:: Shell

git clone git@github.com:Josef-Friedrich/phrydy.git
cd phrydy
pip install .

Usage

Basic usage:

::

>>> from phrydy import MediaFileExtended
>>> f = MediaFileExtended('Lucy.mp3')
>>> f.title
'Lucy in the Sky with Diamonds'
>>> f.artist = 'The Beatles'
>>> f.save()

List all available fields of a media file:

.. code:: Python

from phrydy import MediaFileExtended

media_file = MediaFileExtended('tests/files/full.mp3')

for key in MediaFileExtended.readable_fields():
    value = getattr(media_file, key)
    if key != 'art' and value:
        print('{}: {}'.format(key, value))

.. list-table:: Fields documentation :widths: 20 10 50 20 :header-rows: 1

    • Field name
    • Category
    • Description
    • Examples
    • acoustid_fingerprint
    • music_brainz
    • The Acoustic Fingerprint for the track. The fingerprint is based on the audio information found in a file, and is calculated using the Chromaprint software.
    • acoustid_id
    • music_brainz
    • The AcoustID associated with the track. The AcoustID is the identifier assigned to an audio file based on its acoustic fingerprint. Multiple fingerprints may be assigned the same AcoustID if the fingerprints are similar enough.
    • 86e217b7-d3ad-4493-a9f2-cf71256ace07
    • album
    • common
    • The title of the release.
    • Help!
    • albumartist
    • common
    • The artist for the entire album, which may be different from the artists for the individual tracks. The artists primarily credited on the release, separated by the specified join phrases.
    • The Beatles
    • albumartist_credit
    • common
    • The release-specific artist credit name, which may be a variation of the artist’s “canonical” name.
    • albumartist_sort
    • common
    • The release artists sort names, separated by the specified join phrases. (e.g.: “Beatles, The”).
    • Beatles, The
    • albumartists
    • common
    • The album artists specifed as a list.
    • ['The Beatles']
    • albumartists_credit
    • common
    • The release-specific artists credit names, which may be a variation of the artist’s “canonical” names.
    • albumartists_sort
    • common
    • The “sort name” of the artist for the entire album.
    • Beatles, The, White, Jack
    • albumdisambig
    • common
    • The disambiguation album field helps to distinguish between identically named albums. The album “Weezer” for example has the disambiguation comments “Red Album” and “Green Album”.
    • albumstatus
    • common
    • The status describes how "official" a release is.
    • official, promotional, bootleg, pseudo-release
    • albumtype
    • common
    • The primary MusicBrainz release group type; the MusicBrainz wiki has a list of type names.
    • album/soundtrack
    • albumtypes
    • common
    • The MusicBrainz release group types; the MusicBrainz wiki has a list of type names.
    • ['album', 'soundtrack']
    • arranger
    • common
    • A musician who creates arrangements.
    • art
    • common
    • Legacy album art field.
    • b'\xff\xd8\xff\xe0\x00'
    • artist
    • common
    • The track artist names, separated by the specified join phrases.
    • The Beatles
    • artist_credit
    • common
    • The track-specific artist credit name, which may be a variation of the artist’s “canonical” name.
    • artist_sort
    • common
    • The “sort name” of the track artist.
    • Beatles, The, White, Jack
    • artists
    • common
    • A multi-value field containing the track artist names.
    • ['a-ha'], ['Anouk', 'Remon Stotijn']
    • artists_credit
    • common
    • The track-specific artists credit names, which may be a variation of the artist’s “canonical” names.
    • artists_sort
    • common
    • The “sort name” of the track artists.
    • ['Beatles, The', 'White, Jack']
    • asin
    • common
    • The Amazon Standard Identification Number - the number identifying the item on Amazon.
    • B000002UAL
    • barcode
    • common
    • The barcode assigned to the release. There are many different types of barcode, but the ones usually found on music releases are two: 1. Universal Product Code (UPC), which is the original barcode used in North America. 2. European Article Number (EAN).
    • 5028421931838, 036000291452
    • bitdepth
    • audio
    • The number of bits per sample in the audio encoding (an int). Only available for certain file formats (zero where unavailable).
    • 16
    • bitrate
    • audio
    • The number of bits per seconds used in the audio coding (an int). If this is provided explicitly by the compressed file format, this is a precise reflection of the encoding. Otherwise, it is estimated from the on-disk file size. In this case, some imprecision is possible because the file header is incorporated in the file size.
    • 436523, 256000
    • bitrate_mode
    • common
    • The mode of the bitrate used in the audio coding (a string, eg. "CBR", "VBR" or "ABR"). Only available for the MP3 file format (empty where unavailable).
    • CBR
    • bpm
    • common
    • The number of beats per minute of the track.
    • catalognum
    • common
    • A number assigned to the release by the label which can often be found on the spine or near the barcode. There may be more than one, especially when multiple labels are involved.
    • CDP 7 46439 2
    • catalognums
    • common
    • Multiple numbers assigned to the release by the label which can often be found on the spine or near the barcode. There may be more than one, especially when multiple labels are involved.
    • ['CDP 7 46439 2', 'Do 247282']
    • channels
    • audio
    • The number of channels in the audio (an int).
    • 1, 2
    • comments
    • common
    • The disambiguation comment entered to help distinguish one release from another (e.g.: Deluxe version with 2 bonus tracks).
    • comp
    • common
    • Compilation flag.
    • True, False
    • composer
    • common
    • The name of the composer.
    • Ludwig van Beethoven
    • composer_sort
    • common
    • The composer name for sorting.
    • Beethoven, Ludwig van
    • copyright
    • common
    • The copyright message for the copyright holder of the original sound, beginning with a year and a space character.
    • country
    • common
    • The country the release was issued in.
    • NL, EN, GB
    • date
    • date
    • The release date of the specific release.
    • 1996-01-01
    • day
    • date
    • The release day of the specific release.
    • 31
    • disc
    • common
    • The number of the disc.
    • 1
    • disctitle
    • common
    • Mediums are always included in a release, and have a position in said release (e.g. disc 1 or disc 2). They have a format, like CD, 12" vinyl or cassette (in some cases this will be unknown), and can have an optional title (e.g. disc 2: The Early Years).
    • disc 2: The Early Years
    • disctotal
    • common
    • The total number of discs.
    • 1
    • encoder
    • common
    • The name of the person or organisation that encoded the audio file. This field may contain a copyright message, if the audio file also is copyrighted by the encoder.
    • iTunes v7.6.2
    • encoder_info
    • common
    • The name and/or version of the encoder used (a string, eg. "LAME 3.97.0"). Only av
View on GitHub
GitHub Stars8
CategoryDevelopment
Updated1mo ago
Forks0

Languages

Python

Security Score

90/100

Audited on Feb 16, 2026

No findings