Maxximiliann

Maxximiliann

Supervising Python processes from Elixir

My Elixir project must rely on PyWaves, a Python library, to execute trades. Erlport and Pyrlang looked like attractive solutions for reliable connectivity between the two but, after further inspection, it appears both projects have been abandoned.

gRPC seems to be a viable alternative but before going down that rabbit hole I have to ask, are there any actively maintained libraries that offer simple, featherweight, direct solutions to establishing, maintaining and monitoring communications between Elixir and Python codebases running on the same machine?

Most Liked

skosch

skosch

Shameless plug: there is a small Python library called erlastic that handles the conversion between Erlang’s and Python’s internal encoding of strings, numbers, objects etc. It’s not mine but I maintain a fork here which AFAIK is the most up-to-date version. I’ve been using this thing with ports for years – I outsource numerical computation jobs to Python scripts, and it works great.

mindok

mindok

This is a great article showing exactly what it means to use ports to connect Elixir & Python (for a different use case): https://www.poeticoding.com/real-time-object-detection-with-phoenix-and-python/

hauleth

hauleth

You can use regular ports (Erlport is just wrapper on top of that) or C-Nodes.

skosch

skosch

Sorry, good question! I should put it on PyPi. You should be able to install it directly from Github though; I simply use pip3 install git+https://github.com/skosch/python-erlastic.

mindok

mindok

I believe so - a single Elixir process can control multiple ports, and you can obviously also have multiple processes controlling one or more ports.

Also, another article that is worth reading is https://www.theerlangelist.com/article/outside_elixir

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement