Submodule meta
¶
Class for metadata maniplation
- exception mscxyz.meta.UnmatchedFormatStringError(format_string: str, input_string: str)[source]¶
Bases:
Exception
- class mscxyz.meta.Metatag(score: Score)[source]¶
Bases:
object
The class provides access to the MuseScore metadata fields.
The class should not be renamed to
MetaTag
because it would conflict with the naming scheme of the fieldsmetatag_title
etc.- See:
The available
metaTag
fields are:arranger
audioComUrl (new in v4)
composer
copyright
creationDate
lyricist
movementNumber
movementTitle
mscVersion
platform
poet (not in v4)
source
sourceRevisionId
subtitle
translator
workNumber
workTitle
version 4
<museScore version="4.20"> <Score> <metaTag name="arranger"></metaTag> <metaTag name="audioComUrl"></metaTag> <metaTag name="composer">Composer / arranger</metaTag> <metaTag name="copyright"></metaTag> <metaTag name="creationDate">2024-01-05</metaTag> <metaTag name="lyricist"></metaTag> <metaTag name="movementNumber"></metaTag> <metaTag name="movementTitle"></metaTag> <metaTag name="platform">Linux</metaTag> <metaTag name="source"></metaTag> <metaTag name="sourceRevisionId"></metaTag> <metaTag name="subtitle">Subtitle</metaTag> <metaTag name="translator"></metaTag> <metaTag name="workNumber"></metaTag> <metaTag name="workTitle">Untitled score</metaTag>
- fields¶
- xml_root: _Element¶
- property arranger: str | None¶
<metaTag name="arranger">...</metaTag>
- property audio_com_url: str | None¶
<metaTag name="audioComUrl">...</metaTag>
- property composer: str | None¶
Same text as “Composer” on the first page of the score
<metaTag name="composer">...</metaTag>
- property copyright: str | None¶
Same text as “Copyright” on the first page of the score.
<metaTag name="copyright">...</metaTag>
- property creation_date: str | None¶
-
<metaTag name="creationDate">2024-01-05</metaTag>
- property lyricist: str | None¶
Same text as “Lyricist” on the first page of the score.
<metaTag name="lyricist">...</metaTag>
- property movement_number: str | None¶
<metaTag name="movementNumber">...</metaTag>
- property movement_title: str | None¶
<metaTag name="movementTitle">...</metaTag>
- property msc_version: str | None¶
<metaTag name="mscVersion">4.20</metaTag>
- property platform: str | None¶
The computing platform the score was created on. This might be empty if the score was saved in test mode.
<metaTag name="platform">Linux</metaTag> <metaTag name="platform">Apple Macintosh</metaTag>
- property poet: str | None¶
<metaTag name="poet">...</metaTag>
- property source: str | None¶
May contain a URL if the score was downloaded from or Publish to MuseScore.com.
<metaTag name="source">http://musescore.com/isaacweiss/getting-started</metaTag> <metaTag name="source">http://musescore.com/score/111410</metaTag>
- property source_revision_id: str | None¶
<metaTag name="sourceRevisionId">...</metaTag>
- property subtitle: str | None¶
The subtitle. It has the same text as “Subtitle” on the first page of the score.
<metaTag name="subtitle">Subtitle</metaTag>
- property translator: str | None¶
<metaTag name="translator">...</metaTag>
- property work_number: str | None¶
<metaTag name="workNumber">...</metaTag>
- property work_title: str | None¶
The Work Title. It has the same text as “Title” on the first page of the score.
<metaTag name="workTitle">Untitled score</metaTag>
- class mscxyz.meta.Vbox(score: Score)[source]¶
Bases:
object
The first vertical box or frame of a score.
Available fields:
Composer
Lyricist
Subtitle
Title
Version 2, 3
<Staff id="1"> <VBox> <height>10</height> <Text> <style>Title</style> <text>Title</text> </Text> <Text> <style>Composer</style> <text>Composer</text> </Text> </VBox> </Staff>
Version 4
<Staff id="1"> <VBox> <height>10</height> <boxAutoSize>0</boxAutoSize> <eid>4294967418</eid> <Text> <eid>8589934598</eid> <style>title</style> <text>Title</text> </Text> <Text> <eid>12884901894</eid> <style>composer</style> <text>Composer</text> </Text> </VBox> </Staff>
- fields¶
- xml_root: _Element¶
- vbox: _Element¶
- property title: str | None¶
The title text field of the first vertical box or frame of a score.
<Staff id="1"> <VBox> <height>10</height> <boxAutoSize>0</boxAutoSize> <eid>4294967418</eid> <Text> <eid>8589934598</eid> <style>title</style> <text>Mondscheinsonate</text> </Text> </VBox> </Staff>
- property subtitle: str | None¶
The subtitle text field of the first vertical box or frame of a score.
<Staff id="1"> <VBox> <height>10</height> <boxAutoSize>0</boxAutoSize> <eid>4294967418</eid> <Text> <eid>8589934598</eid> <style>subtitle</style> <text>1. Satz</text> </Text> </VBox> </Staff>
- property composer: str | None¶
The composer text field of the first vertical box or frame of a score.
<Staff id="1"> <VBox> <height>10</height> <boxAutoSize>0</boxAutoSize> <eid>4294967418</eid> <Text> <eid>8589934598</eid> <style>composer</style> <text>Ludwig van Beethoven</text> </Text> </VBox> </Staff>
- property lyricist: str | None¶
The composer text field of the first vertical box or frame of a score.
<Staff id="1"> <VBox> <height>10</height> <boxAutoSize>0</boxAutoSize> <eid>4294967418</eid> <Text> <eid>8589934598</eid> <style>lyricist</style> <text>Johann Wolfgang von Goethe</text> </Text> </VBox> </Staff>
- class mscxyz.meta.Meta(score: Score)[source]¶
Bases:
object
- delete_duplicates() None [source]¶
Delete duplicates in the metadata.
This method checks if the
lyricist
andcomposer
are the same, and if so, it setslyricist
to an empty string.It also checks if
title
is empty butsubtitle
is not, and if so, it setstitle
tosubtitle
.Finally, it checks if
subtitle
is the same astitle
, and if so, it setssubtitle
to an empty string.
- reload(save: bool = False) Meta [source]¶
Reload the MuseScore file.
- Parameters:
save – Whether to save the changes before reloading. Default is False.
- Returns:
The reloaded Meta object.
- See:
- property title: str | None¶
Get and set the value of
Vbox.title
andMetatag.work_title
all at once.If the attributes have different values, then the attribute
Vbox.title
is preferred.
- property subtitle: str | None¶
Get and set the value of
Vbox.subtitle
,Metatag.subtitle
andMetatag.movement_title
all at once.If the attributes have different values, then the attribute
Vbox.subtitle
is preferred.
- property composer: str | None¶
Get and set the value of
Vbox.composer
andMetatag.composer
all at once.If the attributes have different values, then the attribute
Vbox.composer
is preferred.
- property lyricist: str | None¶
Get and set the value of
Vbox.lyricist
andMetatag.lyricist
all at once.If the attributes have different values, then the attribute
Vbox.lyricist
is preferred.