Skip to main content

Leverages the existing Term package to implement a simple Erlang port driver that communicates over standard input and output.

Project description

ERPY

This library wraps around the Python version of the Term library to provide a simple mechanism for communicating between an Erlang process and a Python process.

Installation

As always, use pip, preferably within a virtual environment.

pip install erpy

Usage

Encoding and Decoding Erlang Terms

Use the term library. Their documentation is here, and the python version of their library is bundled with this library. If you want to get the Rust one working with PyPi, I'm sure that they would apprecate it :).

Basic Communication over STDIO

Sending Messages From Python

from erpy import stdio_port_connection

inbox, port = stdio_port_connection()
for i in range(100):
    port.send(i)

Receiving Messages In Python

from erpy import stdio_port_connection
from term import Atom

inbox, port = stdio_port_connection()

for msg in inbox:
    if msg == Atom("close"):
        break
    
    with open("output.txt", "a") as f:
        print(f"got {msg}", file=f)

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

erpy-0.1.1.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

erpy-0.1.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file erpy-0.1.1.tar.gz.

File metadata

  • Download URL: erpy-0.1.1.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for erpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c5a5a0f5a1fa885b920c03b38273c38a90c7a50ccf2f8194659fd68842a03b40
MD5 c916e87bd9ef284014703bad467d147a
BLAKE2b-256 bd71874de434110db7023755fce5d8696c8490687f9a01b4770f12dbf971040e

See more details on using hashes here.

File details

Details for the file erpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: erpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for erpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa6816770bda65dcc7b032c8223ede36595d4e9e66e1c3e47c1cb7f526ec764d
MD5 7113a8a7bf1ea243ffc8dc92fedcd0df
BLAKE2b-256 2d835b49b54fe6e438ccb4699e14e22137752ecec1c1d47287866720a60c3979

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page