RecompExternalPython (also known as REPY) is a library designed to solve a persistent problem in the N64Recompiled ecosystem: the necessity of external libraries and the headaches they introduce. This is accomplished by embedding a free-threaded Python runtime into an N64Recompiled mod.
This webside contains the documentation for the project. This is currently a first draft, with more comprehensive tutorials to be written in the future.
In cases where an N64Recompiled mod needs to 'break containment' and access system resources that wouldn't have been available to a Nintendo 64 (such as file I/O, networking, getting the system time, etc), the de facto solution is to compile an external shared library (commonly referred to as an 'extlib' by the N64Recompiled modding community), and package that alongside the mod's .nrm file. This solution does work, but has several major drawbacks for mod developers. Some of these issues are:
REPY aims to provide modders with an easier alternative to creating their own extlibs. By embedding the runtime for an interpreted programming language (specifically, Python 3.14, free-threaded build) into an N64Recompiled extlib of its own, mods can instruct REPY to interact with the host system on their behalf. In essence, REPY is a single extlib that encompasses the vast majority of cases where extlibs would be required.
This enables REPY to provide easy solutions to the problems above:
What REPY will NOT do is enable you to write an entire mod with Python. There are still aspects of N64Recompiled modding that must be handled through recompiled mod code, such as hooks and patches, that REPY cannot handle using Python. REPY merely offers an easier way to do things that mod code can't do alone.
Simply include the repy_api.h header in your mod's source files, and add RecompExternalPython:2.0.0 as a dependency for your mod in your mod.toml.
The REPY_FN macros are the recommended interface for interacting with the Python interpreter from recompiled code. See the REPY_FN Overview for a quick overview of how to use it.
Additionally, while REPY is fully capable of running Python code at the speeds required for N64Recompiled games, there are a few known performance pitfalls one should avoid. See the Performance Considerations page for more information.