phrydy package

Module contents

Submodules

phrydy.doc_generator module

phrydy.doc_generator.remove_color(text: str) str[source]

https://stackoverflow.com/a/14693789/10193818

phrydy.doc_generator.get_type_name(t: Any) str[source]
phrydy.doc_generator.print_dict_sorted(dictionary: dict[str, Any], color: bool, align: Literal['left', 'right'] = 'right') None[source]
phrydy.doc_generator.print_section(text: str, color: bool = False) None[source]
phrydy.doc_generator.print_debug(file_path: str, MediaClass: Callable[[str], MediaFileExtended], field_generator: Callable[[], Generator[str, None, None]], color: bool = False) None[source]
phrydy.doc_generator.merge_fields(*fields: Any) Dict[str, FieldDoc][source]

Used in audiorename/args.py

phrydy.doc_generator.get_max_field_length(fields: Dict[str, Any]) int[source]

Get the length of the longest field in the dictionary fields.

Parameters:

fields (dict) – A dictionary to search for the longest field.

phrydy.doc_generator.format_field_as_txt(field_name: str, field_doc: FieldDoc, second_column: int, field_prefix: str = '') str[source]
phrydy.doc_generator.format_fields_as_txt(additional_fields: Dict[str, FieldDoc] | None = None, field_prefix: str = '', color: bool = False) str[source]

Return a formated string containing the documentation about the audio fields.

phrydy.doc_generator.format_field_as_rst_table(field_name: str, field_doc: FieldDoc) str[source]
phrydy.doc_generator.format_fields_as_rst_table(additional_fields: Dict[str, FieldDoc] | None = None) str[source]

phrydy.field_docs module

class phrydy.field_docs.FieldDoc[source]

Bases: TypedDict

description: str
category: Literal['common', 'date', 'audio', 'music_brainz', 'rg', 'r128']
data_type: NotRequired[Literal['int', 'str', 'float', 'list', 'bool', 'bytes']]
examples: NotRequired[List[Any]]
phrydy.field_docs.fields: Dict[str, FieldDoc]

A multidimensional dictionary documenting all metadata fields.

fields = {
    'field': {
        'description': 'Title',
        'category': 'Category',
    },
}

phrydy.mediafile_extended module

class phrydy.mediafile_extended.MediaFileExtended(filething, id3v23=False)[source]

Bases: MediaFile

classmethod fields() Generator[str, None, None][source]

Get the names of all writable properties that reflect metadata tags (i.e., those that are instances of MediaField).

classmethod sorted_fields()[source]

Get the names of all writable metadata fields, sorted in the order that they should be written.

This is a lexicographic order, except for instances of DateItemField, which are sorted in year-month-day order.

classmethod readable_fields() Generator[str, None, None][source]

Get all metadata fields: the writable ones from fields() and also other audio properties.

albumartist_sort

Changed field. Uses TSO2 Uses MP3s’ storage style TSO2.

composer_sort

Changed field. Uses MP3s’ description storage style composersortorder.

mb_workid

Changed Field: The MusicBrainz’ Work ID. Uses the additional storage style musicbrainz work id.

mb_workhierarchy_ids: str | None

All IDs in the work hierarchy. This field corresponds to the field work_hierarchy. The top level work ID appears first. As separator a slash (/) is used.

Example:

e208c5f5-5d37-3dfc-ac0b-999f207c9e46 / 5adc213f-700a-4435-9e95-831ed720f348 / eafec51f-47c5-3c66-8c36-a524246c85f8

work: str | None

The last work in the work hierarchy.

work_hierarchy: str | None

The hierarchy of works: The top level work appears first. As separator is this string used: -->

Example:

Die Zauberflöte, K. 620 --> Die Zauberflöte, K. 620: Akt I --> Die Zauberflöte, K. 620: Act I, Scene II. No. 2 Aria "Was hör' ...

releasegroup_types: str | None

All items in the MusicBrainz’ API related to type: type, primary-type and``secondary-type-list``. Main usage of this field is to determine in a secure manner if the release is a soundtrack.

"release-group": {
  "first-release-date": "1994-09-27",
  "secondary-type-list": [
    "Compilation",
    "Soundtrack"
  ],
  "primary-type": "Album",
  "title": "Pulp Fiction: Music From the Motion Picture",
  "type": "Soundtrack",
  "id": "1703cd63-9401-33c0-87c6-50c4ba2e0ba8"
}