Metadata-Version: 1.0
Name: erlport
Version: 0.2
Summary: Erlang port protocol
Home-page: http://github.com/hdima/erlport
Author: Dmitry Vasiliev
Author-email: dima@hlabs.spb.ru
License: BSD
Description: Erlang port protocol for Python
        ===============================
        
        Erlang port protocol for Python simplify interoperability between Erlang and
        Python. On the Python side write a processor object and pass it to
        ``erlport.PortProtocol`` like this::
        
        from erlport import PortProtocol
        
        class Processor(object):
        
        def hello(self, name):
        return "Hello, %s" % name
        
        if __name__ == "__main__":
        PortProtocol(Processor()).start()
        
        On the Erlang side function ``hello()`` can be called like this::
        
        -module(hello).
        -export([hello/1]).
        
        hello(Name) ->
        Port = open_port({spawn, "python hello.py"},
        [{packet, 1}, nouse_stdio, binary]),
        port_command(Port, term_to_binary({hello, Name})),
        receive
        {Port, {data, Data}} ->
        binary_to_term(Data)
        end.
        
        Test it in the Erlang shell::
        
        1> c(hello).
        {ok,hello}
        2> hello:hello("Bob").
        "Hello, Bob"
        
Keywords: Python Erlang
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries
