Elements

Contents

Elements#

Background#

class fretboardgtr.elements.background.Background[source]#

Bases: FretBoardElement

Background element to be drawn in the final fretboard.

__init__(position, size, config=None)[source]#
Parameters:
  • position (Tuple[float, float]) –

  • size (Tuple[float, float]) –

  • config (BackgroundConfig | None) –

get_svg()[source]#

Convert the Background to a svgwrite object.

This maps the BackgroundConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.background.BackgroundConfig[source]#

Bases: ConfigIniter

Background element configuration.

__init__(color='none', opacity=0.7)[source]#
Parameters:
  • color (str) –

  • opacity (float) –

Return type:

None

color: str = 'none'[source]#
opacity: float = 0.7[source]#

Frets#

class fretboardgtr.elements.frets.Fret[source]#

Bases: FretBoardElement

Fret element to be drawn in the final fretboard.

__init__(start_position, end_position, config=None)[source]#
Parameters:
  • start_position (Tuple[float, float]) –

  • end_position (Tuple[float, float]) –

  • config (FretConfig | None) –

get_svg()[source]#

Convert the Fret to a svgwrite object.

This maps the FretConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.frets.FretConfig[source]#

Bases: ConfigIniter

Frets element configuration.

__init__(color='rgb(150,150,150)', width=3)[source]#
Parameters:
  • color (str) –

  • width (int) –

Return type:

None

color: str = 'rgb(150,150,150)'[source]#
width: int = 3[source]#

Fret numbers#

class fretboardgtr.elements.fret_number.FretNumber[source]#

Bases: FretBoardElement

Fret numbers elements to be drawn in the final fretboard.

__init__(name, position, config=None)[source]#
Parameters:
  • name (str) –

  • position (Tuple[float, float]) –

  • config (FretNumberConfig | None) –

get_svg()[source]#

Convert the FretNumber to a svgwrite object.

This maps the FretNumberConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.fret_number.FretNumberConfig[source]#

Bases: ConfigIniter

FretNumber element configuration.

__init__(color='rgb(150,150,150)', fontsize=20, fontweight='bold')[source]#
Parameters:
  • color (str) –

  • fontsize (int) –

  • fontweight (str) –

Return type:

None

color: str = 'rgb(150,150,150)'[source]#
fontsize: int = 20[source]#
fontweight: str = 'bold'[source]#

Neck Dots#

class fretboardgtr.elements.neck_dots.NeckDot[source]#

Bases: FretBoardElement

Neck dots elements to be drawn in the final fretboard.

__init__(position, config=None)[source]#
Parameters:
  • position (Tuple[float, float]) –

  • config (NeckDotConfig | None) –

get_svg()[source]#

Convert the NeckDot to a svgwrite object.

This maps the NeckDotConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.neck_dots.NeckDotConfig[source]#

Bases: ConfigIniter

NeckDot element configuration.

__init__(color='rgb(200,200,200)', stroke_color='rgb(0,0,0)', stroke_width=2, radius=7)[source]#
Parameters:
  • color (str) –

  • stroke_color (str) –

  • stroke_width (int) –

  • radius (int) –

Return type:

None

color: str = 'rgb(200,200,200)'[source]#
radius: int = 7[source]#
stroke_color: str = 'rgb(0,0,0)'[source]#
stroke_width: int = 2[source]#

Nut#

class fretboardgtr.elements.nut.Nut[source]#

Bases: FretBoardElement

Nut element to be drawn in the final fretboard.

__init__(start_position, end_position, config=None)[source]#
Parameters:
  • start_position (Tuple[float, float]) –

  • end_position (Tuple[float, float]) –

  • config (NutConfig | None) –

get_svg()[source]#

Convert the Nut to a svgwrite object.

This maps the NutConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.nut.NutConfig[source]#

Bases: ConfigIniter

Nut element configuration.

__init__(color='rgb(0,0,0)', width=6)[source]#
Parameters:
  • color (str) –

  • width (int) –

Return type:

None

color: str = 'rgb(0,0,0)'[source]#
width: int = 6[source]#

String#

class fretboardgtr.elements.strings.String[source]#

Bases: FretBoardElement

String elements to be drawn in the final fretboard.

__init__(start_position, end_position, width=None, config=None)[source]#
Parameters:
  • start_position (Tuple[float, float]) –

  • end_position (Tuple[float, float]) –

  • width (int | None) –

  • config (StringConfig | None) –

get_svg()[source]#

Convert the String to a svgwrite object.

This maps the StringConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.strings.StringConfig[source]#

Bases: ConfigIniter

String element configuration.

__init__(color='rgb(0,0,0)', width=3)[source]#
Parameters:
  • color (str) –

  • width (int) –

Return type:

None

color: str = 'rgb(0,0,0)'[source]#
width: int = 3[source]#

Tuning#

class fretboardgtr.elements.tuning.Tuning[source]#

Bases: FretBoardElement

Tuning texts elements to be drawn in the final fretboard.

__init__(name, position, config=None)[source]#
Parameters:
  • name (str) –

  • position (Tuple[float, float]) –

  • config (TuningConfig | None) –

get_svg()[source]#

Convert the Tuning to a svgwrite object.

This maps the TuningConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.tuning.TuningConfig[source]#

Bases: ConfigIniter

Tuning element configuration.

__init__(color='rgb(150,150,150)', fontsize=20, fontweight='normal')[source]#
Parameters:
  • color (str) –

  • fontsize (int) –

  • fontweight (str) –

Return type:

None

color: str = 'rgb(150,150,150)'[source]#
fontsize: int = 20[source]#
fontweight: str = 'normal'[source]#

Cross#

class fretboardgtr.elements.cross.Cross[source]#

Bases: FretBoardElement

Cross element to be drawn in the final fretboard.

__init__(position, config=None)[source]#
Parameters:
  • position (Tuple[float, float]) –

  • config (CrossConfig | None) –

get_svg()[source]#

Convert the Cross to a svgwrite object.

This maps the CrossConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.cross.CrossConfig[source]#

Bases: ConfigIniter

Cross element configuration.

__init__(color='rgb(0,0,0)', fontsize=35, fontweight='bold')[source]#
Parameters:
  • color (str) –

  • fontsize (int) –

  • fontweight (str) –

Return type:

None

color: str = 'rgb(0,0,0)'[source]#
fontsize: int = 35[source]#
fontweight: str = 'bold'[source]#

Notes#

class fretboardgtr.elements.notes.FrettedNote[source]#

Bases: FretBoardElement

Fretted notes elements to be drawn in the final fretboard.

__init__(name, position, config=None)[source]#
Parameters:
  • name (str) –

  • position (Tuple[float, float]) –

  • config (FrettedNoteConfig | None) –

get_svg()[source]#

Convert the FrettedNote to a svgwrite object.

This maps the FrettedNoteConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.notes.FrettedNoteConfig[source]#

Bases: ConfigIniter

FrettedNoteConfig(radius: int = 20, color: str = ‘rgb(255,255,255)’, stroke_color: str = ‘rgb(0,0,0)’, stroke_width: int = 3, text_color: str = ‘rgb(0,0,0)’, fontsize: int = 20, fontweight: str = ‘bold’)

__init__(radius=20, color='rgb(255,255,255)', stroke_color='rgb(0,0,0)', stroke_width=3, text_color='rgb(0,0,0)', fontsize=20, fontweight='bold')[source]#
Parameters:
  • radius (int) –

  • color (str) –

  • stroke_color (str) –

  • stroke_width (int) –

  • text_color (str) –

  • fontsize (int) –

  • fontweight (str) –

Return type:

None

color: str = 'rgb(255,255,255)'[source]#
fontsize: int = 20[source]#
fontweight: str = 'bold'[source]#
radius: int = 20[source]#
stroke_color: str = 'rgb(0,0,0)'[source]#
stroke_width: int = 3[source]#
text_color: str = 'rgb(0,0,0)'[source]#
class fretboardgtr.elements.notes.OpenNote[source]#

Bases: FretBoardElement

Open notes elements to be drawn in the final fretboard.

__init__(name, position, config=None)[source]#
Parameters:
  • name (str) –

  • position (Tuple[float, float]) –

  • config (OpenNoteConfig | None) –

get_svg()[source]#

Convert the OpenNote to a svgwrite object.

This maps the OpenNoteConfig configuration attributes to the svg attributes

Return type:

BaseElement

class fretboardgtr.elements.notes.OpenNoteConfig[source]#

Bases: ConfigIniter

OpenNote element configuration.

__init__(radius=20, color='rgb(255,255,255)', stroke_color='rgb(0,0,0)', stroke_width=3, text_color='rgb(0,0,0)', fontsize=20, fontweight='bold')[source]#
Parameters:
  • radius (int) –

  • color (str) –

  • stroke_color (str) –

  • stroke_width (int) –

  • text_color (str) –

  • fontsize (int) –

  • fontweight (str) –

Return type:

None

color: str = 'rgb(255,255,255)'[source]#
fontsize: int = 20[source]#
fontweight: str = 'bold'[source]#
radius: int = 20[source]#
stroke_color: str = 'rgb(0,0,0)'[source]#
stroke_width: int = 3[source]#
text_color: str = 'rgb(0,0,0)'[source]#