ChartParser

class mchartanalyzer.chartparser.ChartParser[source]

Parses data from a chord chart. Looks for information like title, key, chords, and structure.

__weakref__

list of weak references to the object (if defined)

_checkIfChartIsDefinitive(currentChartData, otherCharts)[source]

Checks multiple charts for this song to determine the “definitive” version. Returns true if the current chart is more detailed, meaning it has more sections OR has more chord symbols

_isChordSymbol(text)[source]

Returns true if the given text is a chord symbol.

_isSectionSymbol(text)[source]

Returns true if the given text is probably a section marking, such as “Chorus” or “Verse”.

_parseChords(chartText)[source]

Parses the chord chart for chord symbols, such as “Gmaj7” or “F#m7b5”

_parseSections(textLine)[source]

Parses the chord chart for section markings, such as “Chorus” or “Verse”.

_removeSlashChordBass(chordSymbol)[source]

Remove the bass note from slash chord symbols. For example, this function would take “Gm7/Bb” and return “Gm7”.

parseChart(songTitle, chartSourceUrl, chartContent)[source]

Core function of the Parser. Calls a series of internal parsing methods to extract data from a chord chart.

setArtistData(name, sources, artistSourceUrls)[source]

Sets the current artist info for the parser.