nallwhy
Doumi.Port - A helper library that facilitates the usage of Python in Elixir
Doumi.Port is a helper library that facilitates the usage of Python in Elixir powered by Erlport, NimblePool.
https://github.com/nallwhy/doumi_port
It’s inspired by Export, but not just a wrapper of Erlport, will be a toolchain for using Python, Ruby in Elixir.
defmodule MyApp.Application do
...
@impl true
def start(_type, _args) do
children = [
...
{Doumi.Port.Pool, port: {Doumi.Port.Python, python_path: [...]}, name: MyApp.PythonPool}
]
Supervisor.start_link(children, strategy: :one_for_one, name: MyApp.Supervisor)
end
end
defmodule MyApp.Native do
def add(a, b) do
Doumi.Port.Pool.command(MyApp.PythonPool, :operator, :add, [a, b])
end
end
> MyApp.Native.add(1, 2)
3
Thanks!
Most Liked
nallwhy
v0.4.0 is released!
- It supports Ruby also.
mix doumi.port.init,mix doumi.port.setupis added.
# Create requirements.txt, .gitignores to ./priv/python
mix doumi.port.init --port python
# Add Python dependency
echo "pypdf2==3.0.1" >> ./priv/python/requirements.txt
# Install Python dependecies
mix doumi.port.setup --port python
You can install Python dependencies to your release with mix doumi.port.setup.
defmodule MyApp.MixProject do
defp aliases do
[
...,
"release.setup": ["doumi.port.setup --port python", ...]
]
end
end
...
# release setup (ex. install Python dependencies, compile assets)
RUN mix release.setup
...
4
nallwhy
v0.2.0 is released!
use macro is added to make it easier.
defmodule MyApp.PythonPool do
use Doumi.Port.Pool,
port: {Doumi.Port.Python, python_path: [...]}
end
defmodule MyApp.Application do
...
@impl true
def start(_type, _args) do
children = [
...
MyApp.PythonPool
]
Supervisor.start_link(children, strategy: :one_for_one, name: MyApp.Supervisor)
end
end
defmodule MyApp.Native do
def add(a, b) do
MyApp.PythonPool.command(:operator, :add, [a, b])
end
end
2
ivanhercaz
I will test it as soon as possible! ![]()
![]()
I recommend you to link to the Doumi.Port repository and the Hex package in the post. It will be easier for the people to check them
.
1
Popular in Announcing
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
I’ve just released stable versions of my Prometheus Elixir libs:
Elixir client [docs];
Ecto collector [docs];
Plugs instrumenter/Export...
New
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM.
...
New
Presenting Aviacommerce, open source e-commerce platform in Elixir
Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
Rummage.Ecto and Rummage.Phoenix provide ways to perform Searching, Sorting and Pagination over Ecto queries and Phoenix collections.
Fo...
New
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library.
The progre...
New
Hey everyone
i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
Hey all,
We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3!
We have successfully on-boarded the full suite of integration tests (...
New
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New
Hi! :waving_hand:
I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
New
Other popular topics
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
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
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors:
[WARN] - (starship::utils): Executing command ...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









