Welcome to python-ly's documentation!
*************************************

This package provides a Python library *ly* containing various Python
modules to parse, manipulate or create documents in LilyPond format. A
command line program *ly* is also provided that can be used to do
various manipulations with LilyPond files.

The LilyPond format is a plain text input format that is used by the
GNU music typesetter LilyPond (www.lilypond.org).

The python-ly package is Free Software, licensed under the GPL. This
package is written by the Frescobaldi developers and is used
extensively by the Frescobaldi project. The main author is Wilbert
Berendsen.

   Download from: https://pypi.python.org/project/python-ly
   Development homepage: https://github.com/frescobaldi/python-ly

This documentation describes python-ly 0.9.10.

Contents:

* The "ly" command

  * Options

  * Arguments

  * Commands

  * Variables

  * Examples

* The "ly-server" command

  * Server Options

  * Command Options

  * HTTP Requests

    * GET Requests

    * POST Requests

    * Response Object

    * Commands

    * Variables

  * Examples

    * Sample Requests

* The "ly" package

  * Module contents

  * Subpackages

    * ly.lex package

      * Module contents

      * Submodules

      * ly.lex.docbook module

      * ly.lex.html module

      * ly.lex.latex module

      * ly.lex.lilypond module

      * ly.lex.scheme module

      * ly.lex.texinfo module

    * ly.music package

      * Module contents

      * Submodules

      * ly.music.event module

      * ly.music.items module

      * ly.music.read module

    * ly.musicxml package

      * Module contents

      * Submodules

      * ly.musicxml.create_musicxml module

      * ly.musicxml.ly2xml_mediator module

      * ly.musicxml.lymus2musxml module

      * ly.musicxml.xml_objs module

    * ly.pitch package

      * Module contents

      * Submodules

      * ly.pitch.abs2rel module

      * ly.pitch.rel2abs module

      * ly.pitch.translate module

      * ly.pitch.transpose module

    * ly.xml package

      * Introduction

      * Module contents

      * The "xml-export.ily" file

      * Example

    * ly.data package

      * Module contents

      * Submodules

      * ly.data.makeschemedata module

    * ly.cli package

      * Module contents

      * Submodules

      * ly.cli.command module

      * ly.cli.main module

    * ly.server package

      * Module contents

      * Submodules

      * ly.server.command module

      * ly.server.handler module

      * ly.server.main module

      * ly.server.options module

  * Submodules

  * ly.slexer module

    * slexer -- Stateful Lexer

    * "FallthroughParser"

      * "FallthroughParser.fallthrough()"

      * "FallthroughParser.parse()"

    * "Fridge"

      * "Fridge.count()"

      * "Fridge.freeze()"

      * "Fridge.thaw()"

    * "Parser"

      * "Parser.default"

      * "Parser.fallthrough()"

      * "Parser.freeze()"

      * "Parser.items"

      * "Parser.parse()"

      * "Parser.re_flags"

      * "Parser.thaw()"

      * "Parser.token()"

      * "Parser.update_state()"

    * "State"

      * "State.depth()"

      * "State.enter()"

      * "State.follow()"

      * "State.freeze()"

      * "State.leave()"

      * "State.parser()"

      * "State.parsers()"

      * "State.replace()"

      * "State.thaw()"

      * "State.tokens()"

    * "Token"

      * "Token.end"

      * "Token.pos"

      * "Token.rx"

      * "Token.test_match()"

      * "Token.update_state()"

  * ly.document module

    * DocumentBase and Document

    * Cursor

    * Runner

    * Source

    * "Cursor"

      * "Cursor.blocks()"

      * "Cursor.document"

      * "Cursor.end_block()"

      * "Cursor.has_selection()"

      * "Cursor.lstrip()"

      * "Cursor.rstrip()"

      * "Cursor.select_all()"

      * "Cursor.select_end_of_block()"

      * "Cursor.select_start_of_block()"

      * "Cursor.start_block()"

      * "Cursor.strip()"

      * "Cursor.text()"

      * "Cursor.text_after()"

      * "Cursor.text_before()"

    * "Document"

      * "Document.apply_changes()"

      * "Document.block()"

      * "Document.copy()"

      * "Document.index()"

      * "Document.initial_state()"

      * "Document.isvalid()"

      * "Document.load()"

      * "Document.mode()"

      * "Document.modified"

      * "Document.position()"

      * "Document.setmode()"

      * "Document.setplaintext()"

      * "Document.state_end()"

      * "Document.text()"

      * "Document.tokens()"

    * "DocumentBase"

      * "DocumentBase.apply_changes()"

      * "DocumentBase.block()"

      * "DocumentBase.blocks_backward()"

      * "DocumentBase.blocks_forward()"

      * "DocumentBase.check_changes()"

      * "DocumentBase.encoding"

      * "DocumentBase.filename"

      * "DocumentBase.index()"

      * "DocumentBase.initial_state()"

      * "DocumentBase.isblank()"

      * "DocumentBase.isvalid()"

      * "DocumentBase.next_block()"

      * "DocumentBase.plaintext()"

      * "DocumentBase.position()"

      * "DocumentBase.previous_block()"

      * "DocumentBase.setplaintext()"

      * "DocumentBase.size()"

      * "DocumentBase.state()"

      * "DocumentBase.state_end()"

      * "DocumentBase.text()"

      * "DocumentBase.tokens()"

      * "DocumentBase.tokens_with_position()"

      * "DocumentBase.update_cursors()"

    * "Runner"

      * "Runner.at()"

      * "Runner.backward()"

      * "Runner.backward_line()"

      * "Runner.copy()"

      * "Runner.document"

      * "Runner.forward()"

      * "Runner.forward_line()"

      * "Runner.move_to_block()"

      * "Runner.next()"

      * "Runner.next_block()"

      * "Runner.position()"

      * "Runner.previous()"

      * "Runner.previous_block()"

      * "Runner.set_position()"

      * "Runner.token()"

    * "Source"

      * "Source.consume()"

      * "Source.document"

      * "Source.next()"

      * "Source.position()"

      * "Source.pushback()"

      * "Source.token()"

      * "Source.until_parser_end()"

  * ly.docinfo module

    * "DocInfo"

      * "DocInfo.complete()"

      * "DocInfo.count_tokens()"

      * "DocInfo.counted_tokens()"

      * "DocInfo.definitions()"

      * "DocInfo.document"

      * "DocInfo.find()"

      * "DocInfo.find_all()"

      * "DocInfo.global_staff_size()"

      * "DocInfo.has_output()"

      * "DocInfo.include_args()"

      * "DocInfo.language()"

      * "DocInfo.markup_definitions()"

      * "DocInfo.mode()"

      * "DocInfo.output_args()"

      * "DocInfo.range()"

      * "DocInfo.scheme_load_args()"

      * "DocInfo.token_hash()"

      * "DocInfo.version()"

      * "DocInfo.version_string()"

  * ly.barcheck module

    * "event"

      * "event.append()"

    * "insert()"

    * "remove()"

  * ly.colorize module

    * "HtmlWriter"

      * "HtmlWriter.bgcolor"

      * "HtmlWriter.css_mapper"

      * "HtmlWriter.css_scheme"

      * "HtmlWriter.document_id"

      * "HtmlWriter.encoding"

      * "HtmlWriter.fgcolor"

      * "HtmlWriter.full_html"

      * "HtmlWriter.html()"

      * "HtmlWriter.inline_style"

      * "HtmlWriter.linenumbers_bgcolor"

      * "HtmlWriter.linenumbers_fgcolor"

      * "HtmlWriter.linenumbers_id"

      * "HtmlWriter.number_lines"

      * "HtmlWriter.set_wrapper_attribute()"

      * "HtmlWriter.set_wrapper_tag()"

      * "HtmlWriter.stylesheet_ref"

      * "HtmlWriter.title"

      * "HtmlWriter.wrapper_attribute"

      * "HtmlWriter.wrapper_tag"

    * "Mapper"

    * "add_line_numbers()"

    * "css_attr()"

    * "css_class"

      * "css_class.base"

      * "css_class.mode"

      * "css_class.name"

    * "css_dict()"

    * "css_group()"

    * "css_item()"

    * "css_mapper()"

    * "css_style_attribute_formatter"

    * "default_mapping()"

    * "format_css_span_class()"

    * "format_html_document()"

    * "format_stylesheet()"

    * "get_tokens()"

    * "html()"

    * "html_escape()"

    * "html_escape_attr()"

    * "html_format_attrs()"

    * "map_tokens()"

    * "melt_mapped_tokens()"

    * "style"

      * "style.base"

      * "style.classes"

      * "style.name"

  * ly.cursortools module

    * "find_indent()"

    * "select_block()"

  * ly.dom module

    * "AddDuration"

      * "AddDuration.ly()"

    * "AddLyrics"

      * "AddLyrics.after"

      * "AddLyrics.before"

      * "AddLyrics.may_remove_brackets"

      * "AddLyrics.name"

    * "Assignment"

      * "Assignment.after"

      * "Assignment.before"

      * "Assignment.ly()"

      * "Assignment.setValue()"

      * "Assignment.value()"

    * "BlankLine"

      * "BlankLine.before"

    * "Block"

      * "Block.after"

      * "Block.before"

      * "Block.defaultSpace"

    * "BlockComment"

      * "BlockComment.after"

      * "BlockComment.before"

      * "BlockComment.ly()"

    * "Book"

      * "Book.name"

    * "BookPart"

      * "BookPart.name"

    * "ChoirStaff"

    * "Chord"

      * "Chord.ly()"

    * "ChordMode"

      * "ChordMode.name"

    * "ChordNames"

    * "Clef"

      * "Clef.ly()"

    * "Command"

    * "CommandEnclosed"

    * "Comment"

      * "Comment.after"

      * "Comment.ly()"

    * "Container"

      * "Container.after"

      * "Container.before"

      * "Container.defaultSpace"

      * "Container.ly()"

    * "Context"

      * "Context.name"

    * "ContextName"

      * "ContextName.ly()"

    * "ContextProperty"

      * "ContextProperty.ly()"

    * "ContextType"

      * "ContextType.addInstrumentNameEngraverIfNecessary()"

      * "ContextType.after"

      * "ContextType.before"

      * "ContextType.ctype"

      * "ContextType.getWith()"

      * "ContextType.isAtom"

      * "ContextType.ly()"

    * "CueVoice"

    * "Devnull"

    * "Document"

      * "Document.after"

      * "Document.defaultSpace"

    * "DrumMode"

      * "DrumMode.name"

    * "DrumStaff"

    * "DrumVoice"

    * "Duration"

      * "Duration.ly()"

    * "Dynamics"

    * "Enclosed"

      * "Enclosed.after"

      * "Enclosed.before"

      * "Enclosed.isAtom"

      * "Enclosed.ly()"

      * "Enclosed.may_remove_brackets"

      * "Enclosed.post"

      * "Enclosed.pre"

    * "FigureMode"

      * "FigureMode.name"

    * "FiguredBass"

    * "FretBoards"

    * "Global"

    * "GrandStaff"

    * "GregorianTranscriptionStaff"

    * "GregorianTranscriptionVoice"

    * "HandleVars"

      * "HandleVars.childClass"

      * "HandleVars.ifbasestring()"

      * "HandleVars.importNode()"

    * "Header"

      * "Header.name"

    * "Identifier"

      * "Identifier.isAtom"

      * "Identifier.ly()"

    * "Include"

      * "Include.ly()"

    * "InnerChoirStaff"

    * "InnerStaffGroup"

    * "InputChords"

      * "InputChords.name"

    * "InputDrums"

      * "InputDrums.name"

    * "InputFigures"

      * "InputFigures.name"

    * "InputLyrics"

      * "InputLyrics.name"

    * "InputMode"

    * "InputNotes"

      * "InputNotes.name"

    * "KeySignature"

      * "KeySignature.ly()"

    * "Layout"

      * "Layout.name"

    * "Leaf"

    * "Line"

      * "Line.after"

      * "Line.before"

    * "LineComment"

      * "LineComment.before"

    * "LyNode"

      * "LyNode.after"

      * "LyNode.before"

      * "LyNode.concat()"

      * "LyNode.isAtom"

      * "LyNode.ly()"

    * "LyricMode"

      * "LyricMode.name"

    * "Lyrics"

    * "LyricsTo"

      * "LyricsTo.ly()"

      * "LyricsTo.name"

    * "Mark"

      * "Mark.name"

    * "Markup"

      * "Markup.name"

    * "MarkupCommand"

    * "MarkupEnclosed"

    * "MensuralStaff"

    * "MensuralVoice"

    * "Midi"

      * "Midi.name"

    * "Named"

      * "Named.ly()"

      * "Named.name"

    * "Newline"

      * "Newline.after"

    * "NoteMode"

      * "NoteMode.name"

    * "NoteNames"

    * "Paper"

      * "Paper.name"

    * "Partial"

      * "Partial.after"

      * "Partial.before"

      * "Partial.name"

    * "PianoStaff"

    * "Pitch"

      * "Pitch.ly()"

    * "Printer"

      * "Printer.indent()"

      * "Printer.indentGen()"

      * "Printer.primary_quote_left"

      * "Printer.primary_quote_right"

      * "Printer.quoteString()"

      * "Printer.secondary_quote_left"

      * "Printer.secondary_quote_right"

    * "QuotedString"

      * "QuotedString.isAtom"

      * "QuotedString.ly()"

    * "Reference"

    * "Relative"

      * "Relative.name"

    * "RhythmicStaff"

    * "Scheme"

      * "Scheme.isAtom"

      * "Scheme.ly()"

    * "SchemeLily"

      * "SchemeLily.post"

      * "SchemeLily.pre"

    * "SchemeList"

      * "SchemeList.ly()"

      * "SchemeList.post"

      * "SchemeList.pre"

    * "Score"

      * "Score.name"

    * "ScoreContext"

      * "ScoreContext.ctype"

    * "Section"

      * "Section.after"

      * "Section.before"

      * "Section.may_remove_brackets"

    * "Seq"

      * "Seq.post"

      * "Seq.pre"

    * "Seqr"

      * "Seqr.may_remove_brackets"

    * "Sim"

      * "Sim.post"

      * "Sim.pre"

    * "Simr"

      * "Simr.may_remove_brackets"

    * "Staff"

    * "StaffGroup"

    * "Statement"

      * "Statement.before"

      * "Statement.isAtom"

    * "StatementEnclosed"

      * "StatementEnclosed.may_remove_brackets"

    * "TabStaff"

    * "TabVoice"

    * "Tempo"

      * "Tempo.after"

      * "Tempo.before"

      * "Tempo.ly()"

    * "Text"

      * "Text.ly()"

    * "TextDur"

    * "TimeSignature"

      * "TimeSignature.ly()"

    * "Transposition"

      * "Transposition.name"

    * "UserContext"

    * "VaticanaStaff"

    * "VaticanaVoice"

    * "Version"

      * "Version.ly()"

    * "Voice"

    * "VoiceSeparator"

      * "VoiceSeparator.ly()"

    * "With"

      * "With.after"

      * "With.before"

      * "With.ly()"

      * "With.name"

  * ly.duration module

    * "base_scaling()"

    * "base_scaling_string()"

    * "format_fraction()"

    * "fraction()"

    * "fraction_string()"

    * "tostring()"

  * ly.etreeutil module

    * "indent()"

    * "isblank()"

  * ly.indent module

    * "Indenter"

      * "Indenter.compute_indent()"

      * "Indenter.decrease_indent()"

      * "Indenter.get_indent()"

      * "Indenter.increase_indent()"

      * "Indenter.indent()"

      * "Indenter.indent_tabs"

      * "Indenter.indent_width"

    * "Line"

      * "Line.is_special_scheme_keyword()"

  * ly.node module

    * "Node"

      * "Node.ancestors()"

      * "Node.append()"

      * "Node.backward()"

      * "Node.clear()"

      * "Node.copy()"

      * "Node.descendants()"

      * "Node.dump()"

      * "Node.extend()"

      * "Node.find()"

      * "Node.find_child()"

      * "Node.find_children()"

      * "Node.find_parent()"

      * "Node.forward()"

      * "Node.index()"

      * "Node.insert()"

      * "Node.insert_before()"

      * "Node.is_descendant_of()"

      * "Node.iter_depth()"

      * "Node.iter_rings()"

      * "Node.next_sibling()"

      * "Node.parent()"

      * "Node.previous_sibling()"

      * "Node.remove()"

      * "Node.replace()"

      * "Node.sort()"

      * "Node.toplevel()"

      * "Node.unlink()"

    * "WeakNode"

      * "WeakNode.parent()"

  * ly.reformat module

    * "break_indenters()"

    * "move_long_comments()"

    * "reformat()"

    * "remove_trailing_whitespace()"

  * ly.rhythm module

    * "music_item"

      * "music_item.dur_tokens"

      * "music_item.end"

      * "music_item.insert_pos"

      * "music_item.may_remove"

      * "music_item.pos"

      * "music_item.tokens"

    * "music_items()"

    * "music_tokens()"

    * "preceding_duration()"

    * "remove_dups()"

    * "rhythm_dot()"

    * "rhythm_double()"

    * "rhythm_explicit()"

    * "rhythm_extract()"

    * "rhythm_halve()"

    * "rhythm_implicit()"

    * "rhythm_implicit_per_line()"

    * "rhythm_overwrite()"

    * "rhythm_remove()"

    * "rhythm_remove_fraction_scaling()"

    * "rhythm_remove_scaling()"

    * "rhythm_undot()"

  * ly.util module

    * "int2letter()"

    * "int2roman()"

    * "int2text()"

    * "mkid()"

  * ly.words module


Indices and tables
******************

* Index

* Module Index

* Search Page
