# Pyrlang Pyrlang makes a Python program a node of an Erlang cluster. It speaks the Erlang distribution protocol on asyncio, so Erlang, Elixir and other BEAM languages reach Python code with what they already use: messages to pids and registered names, links, monitors, `gen_server:call`, `rpc:call`, `spawn/4`. - Python processes with Erlang-compatible pids, registered names and aliases; messages in both directions. - Links and monitors between Python and Erlang processes, both ways. - `rpc:call`, `erpc` and `spawn` from Erlang into Python; a `GenServer` class that answers `gen_server:call` and `cast`. - Talks to Erlang/OTP 25 to 29. Needs Python 3.11 or newer. Three projects work together and can be used apart: - Pyrlang: this project, the node. - {{ term_site }}: Erlang terms as Python values and the External Term Format codec, in Python and in Rust. Pyrlang uses it for every message. - {{ epmd_site }}: an Erlang Port Mapper Daemon in Python, for hosts without Erlang. ## A first node ```{literalinclude} ../../examples/e02_registered_process.py :language: python :pyobject: MyProcess ``` ```{literalinclude} ../../examples/e02_registered_process.py :language: python :pyobject: main ``` From an Erlang shell started with `erl -name erl@127.0.0.1 -setcookie COOKIE`: ```erlang (erl@127.0.0.1)1> {my_process, 'py@127.0.0.1'} ! {self(), <<"hi">>}. (erl@127.0.0.1)2> flush(). Shell got {echo,<<"hi">>} ``` [Getting started](guide.md) goes through this and the other examples. ```{toctree} :maxdepth: 2 :caption: Contents install guide calling_python data_types configuration compatibility reference known-differences changelog ```