igitar/README.rst

64 lines
1.3 KiB
ReStructuredText
Raw Normal View History

2021-09-08 22:01:47 +00:00
igitar
2021-07-29 02:48:02 +00:00
===============
2021-09-08 22:01:47 +00:00
**igitar** *[ee-gee-tahr]* isiXhosa, meaning guitar
``igitar`` is a ChordPro parser, written in Python. The main difference between this module
and other similar libraries is that ``igitar`` parses ChordPro files down to the syllable
2021-07-29 02:48:02 +00:00
level, enabling finer-grained control of the formatted output.
2021-07-29 04:44:06 +00:00
.. warning::
This package is still in development. Only a subset of ChordPro is currently supported, and
some key features are missing, like displaying song metadata.
2021-07-29 02:48:02 +00:00
Installation
------------
2021-09-08 22:01:47 +00:00
You can use ``pip`` to install ``igitar``:
.. code-block:: shell-session
2021-07-29 02:48:02 +00:00
2021-09-08 22:01:47 +00:00
$ pip install igitar
2021-07-29 02:48:02 +00:00
Example Usage
-------------
.. code-block:: python
2021-09-08 22:01:47 +00:00
from igitar import Song
2021-07-29 02:48:02 +00:00
song = Song('path/to/song.chordpro')
for verse in song.verses:
print(verse.title)
Rendering
---------
2021-09-08 22:01:47 +00:00
``igitar`` comes with two renders, HTML and Text.
2021-07-29 02:48:02 +00:00
.. code-block:: python
2021-09-08 22:01:47 +00:00
from igitar.renderers.html import render
2021-07-29 02:48:02 +00:00
print(render(song))
Command Line Interface
----------------------
2021-09-08 22:01:47 +00:00
``igitar`` also ships with a built-in command line interface which will read a ChordPro
2021-07-29 02:48:02 +00:00
file and then render it using either the text or HTML renderer.
2021-09-08 22:01:47 +00:00
For example:
.. code-block:: shell-session
2021-07-29 02:48:02 +00:00
2021-09-08 22:01:47 +00:00
$ igitar path/to/song.chordpro -f text -o song.txt
2021-07-29 02:48:02 +00:00
License
-------
2021-09-08 22:01:47 +00:00
``igitar`` is licensed under the MIT license. See the LICENSE file for more information.