Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fazibear/export
Erlport wrapper for Elixir
https://github.com/fazibear/export
Last synced: 3 days ago
JSON representation
Erlport wrapper for Elixir
- Host: GitHub
- URL: https://github.com/fazibear/export
- Owner: fazibear
- License: mit
- Created: 2016-03-24T23:11:07.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-01T16:34:57.000Z (about 3 years ago)
- Last Synced: 2024-10-13T09:54:10.684Z (2 months ago)
- Language: Elixir
- Homepage:
- Size: 95.7 KB
- Stars: 178
- Watchers: 9
- Forks: 25
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Export [![Package Version](https://img.shields.io/hexpm/v/export.svg)](https://hex.pm/packages/export) [![Build Status](https://travis-ci.org/fazibear/export.svg?branch=master)](https://travis-ci.org/fazibear/export)
[Erlport](http://erlport.org/) wrapper for Elixir.
## Installation
Add export to your list of dependencies in `mix.exs`:
```elixir
def application do
[applications: [:export]]
enddef deps do
[
{:export, "~> 0.1.0"},
]
end
```## Usage
### Ruby
```elixir
defmodule SomeRubyCall do
use Export.Rubydef call_ruby_method do
# path to ruby files
{:ok, ruby} = Ruby.start(ruby_lib: Path.expand("lib/ruby"))# call "upcase" method from "test" file with "hello" argument
ruby |> Ruby.call("test", "upcase", ["hello"])# same as above but prettier
ruby |> Ruby.call(upcase("hello"), from_file: "test")
end
end
```### Python
```elixir
defmodule SomePythonCall do
use Export.Pythondef call_python_method do
# path to our python files
{:ok, py} = Python.start(python_path: Path.expand("lib/python"))# call "upcase" method from "test" file with "hello" argument
py |> Python.call("test", "upcase", ["hello"])# same as above but prettier
val = py |> Python.call(upcase("hello"), from_file: "test")# close the Python process
py |> Python.close()val
end
end
```## Thank you!
[![Become Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/bePatron?u=6912974)