REAPER Project File Parser
Project description
Description
RPP is a format used to describe REAPER projects. This package is designed to be RPP parser/emitter and uses PLY as parser framework.
Examples
Import the package:
>>> import rpp
Decode RPP:
>>> r = rpp.loads("""\
<REAPER_PROJECT 0.1 "4.32" 1372525904
RIPPLE 0
GROUPOVERRIDE 0 0 0
AUTOXFADE 1
>
""")
>>> r
Element(tag='REAPER_PROJECT', attrib=(Decimal('0.1'), '4.32', 1372525904), children=[
Element(tag='RIPPLE', attrib=(0,), children=None),
Element(tag='GROUPOVERRIDE', attrib=(0, 0, 0), children=None),
Element(tag='AUTOXFADE', attrib=(1,), children=None)
])
Transform elements into RPP:
>>> from decimal import Decimal
>>> from rpp import Element
>>> rpp.dumps(
... Element(tag='REAPER_PROJECT', attrib=(Decimal('0.1'), '4.32', 1372525904), children=[
... Element(tag='RIPPLE', attrib=(0,), children=None),
... Element(tag='GROUPOVERRIDE', attrib=(0, 0, 0), children=None),
... Element(tag='AUTOXFADE', attrib=(1,), children=None),
... ]))
'<REAPER_PROJECT 0.1 4.32 1372525904\n RIPPLE 0\n GROUPOVERRIDE 0 0 0\n AUTOXFADE 1\n>\n'
Element mimics the interface of xml.etree.ElementTree.Element. You can perform quering operations with findall, find, iterfind. Note that attribute and text predicates are not supported.
>>> r.find('.//GROUPOVERRIDE')
Element(tag='GROUPOVERRIDE', attrib=(0, 0, 0), children=None)
Dependencies
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rpp-0.2.tar.gz
(5.3 kB
view hashes)
Built Distribution
rpp-0.2-py3-none-any.whl
(7.1 kB
view hashes)