Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A pythonic wrapper for REAPER's ReaScript Python API

Project description

# reapy

reapy is a nice pythonic wrapper around the terribly non-pythonic [ReaScript Python API]( “ReaScript Python API documentation”) for [REAPER]( “REAPER”).

## Getting Started

### Installing

No installer is available yet.

### reapy from inside

Import reapy and use it instead of reaper_python in your ReaScripts.

`python from reapy import CURRENT_PROJECT as project project.print("Hello from inside, world!") `

This Hello World is equivalent to the following.

`python from reaper_python import * RPR_ShowConsoleMsg("Hello from inside, world!") `

### reapy from outside

To use reapy from outside REAPER, you need to load and execute the ReaScript [](reapy/reascript_api/dist_api/ It sets up a local server inside REAPER. Every import of reapy outside REAPER will become a client of this server and request ReaScript API calls from it.

Then you can use reapy as any other Python module in your projects, and interact with REAPER from outside.

`python from reapy import CURRENT_PROJECT as project project.print("Hello from outside, world!") ` ## Usage

### ReaScript API

All ReaScript API functions are available in reapy in the sub-module reapy.reascript_api. Note that in ReaScript Python API, all function names start with “RPR_”. That unnecessary pseudo-namespace has been removed in reapy. Thus, you shall call reapy.reascript_api.GetCursorPosition in order to trigger reaper_python.RPR_GetCursorPosition. See example below.

`python >>> from reapy import reascript_api as RPR >>> RPR.GetCursorPosition() 0.0 >>> RPR.SetEditCurPos(1, True, True) >>> RPR.GetCursorPosition() 1.0 ` ### reapy API

The purpose of reapy is to provide a more pythonic API as a substitute for ReaScript API. Below is the reapy way of executing the example above.

`python >>> from reapy import CURRENT_PROJECT as project >>> project.cursor_position 0.0 >>> project.cursor_position = 1 >>> project.cursor_position 1.0 ` The table [api.csv](docs/api.csv) matches ReaScript functions with their reapy counterparts.

## Author

See also the list of [contributors]( who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-reapy, version 0.1.0.dev1
Filename, size File type Python version Upload date Hashes
Filename, size python_reapy-0.1.0.dev1-py2.py3-none-any.whl (24.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size python-reapy-0.1.0.dev1.tar.gz (18.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page