Read and write Reaper RPP files with Python.
Project description
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:
>>> 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=['0.1', '4.32', '1372525904'], children=[
['RIPPLE', '0'],
['GROUPOVERRIDE', '0', '0', '0'],
['AUTOXFADE', '1'],
])
Transform elements into RPP:
>>> 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'],
... ]))
'<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 querying operations with findall, find, iterfind. Note that attribute and text predicates are not supported.
>>> 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
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.5.tar.gz
(11.0 kB
view details)
Built Distribution
rpp-0.5-py3-none-any.whl
(6.4 kB
view details)
File details
Details for the file rpp-0.5.tar.gz
.
File metadata
- Download URL: rpp-0.5.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b8dfdcef4b2c51ed107e5acfac0c88c21aefc941c42072387bb894c607d3f58 |
|
MD5 | 89584e7c1a06fa2bdfb4630c5795bd6c |
|
BLAKE2b-256 | f6366534b9c984718b3a26fcd42e6d21d6f3a6d95bddf014df0c8f2ba30555e0 |
File details
Details for the file rpp-0.5-py3-none-any.whl
.
File metadata
- Download URL: rpp-0.5-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccf54131ee1b5601225583572c38392673e798db35a3ab695d252d5167937d9a |
|
MD5 | 805407f24166a676dc42d4b331daccd3 |
|
BLAKE2b-256 | 84377338baf9c7b1b8a41cc8ae2cc88c8a6b92d8ef131c02e50232c60b291887 |