Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perlence/rpp
Read and write Reaper RPP files with Python.
https://github.com/perlence/rpp
parser ply python python3 reaper
Last synced: about 1 month ago
JSON representation
Read and write Reaper RPP files with Python.
- Host: GitHub
- URL: https://github.com/perlence/rpp
- Owner: Perlence
- License: bsd-3-clause
- Created: 2015-09-28T19:53:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T18:46:09.000Z (over 1 year ago)
- Last Synced: 2024-11-27T11:52:45.342Z (about 1 month ago)
- Topics: parser, ply, python, python3, reaper
- Language: Python
- Homepage:
- Size: 89.8 KB
- Stars: 65
- Watchers: 6
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
RPP
===RPP is a format used to describe `REAPER `_ projects. This package is designed to be an RPP
parser/emitter and uses `PLY `_ as a parser framework.Examples
--------Import the package:
.. code-block:: python
>>> import rpp
Decode RPP:
.. code-block:: python
>>> r = rpp.loads("""\
""")
>>> r
Element(tag='REAPER_PROJECT', attrib=['0.1', '4.32', '1372525904'], children=[
['RIPPLE', '0'],
['GROUPOVERRIDE', '0', '0', '0'],
['AUTOXFADE', '1'],
])Transform elements into RPP:
.. code-block:: python
>>> from rpp import Element
>>> rpp.dumps(
... Element(tag='REAPER_PROJECT', attrib=['0.1', '4.32', '1372525904'], children=[
... ['RIPPLE', '0'],
... ['GROUPOVERRIDE', '0', '0', '0'],
... ['AUTOXFADE', '1'],
... ]))
'\n'``Element`` mimics the interface of xml.etree.ElementTree.Element_. You can perform querying operations with
``findall``, ``find``, ``iterfind``. Note that attribute and text predicates are not supported... _xml.etree.ElementTree.Element: https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element
.. code-block:: python
>>> groupoverride = r.find('.//GROUPOVERRIDE')
>>> groupoverride
['GROUPOVERRIDE', '0', '0', '0']
>>> groupoverride[1:] = ['9', '9', '9']
>>> r
Element(tag='REAPER_PROJECT', attrib=['0.1', '4.32', '1372525904'], children=[
['RIPPLE', '0'],
['GROUPOVERRIDE', '9', '9', '9'],
['AUTOXFADE', '1'],
])Dependencies
------------- `attrs `_
- `ply `_