Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python implementation of the BERT-RPC server
Python
branch: master

Merge pull request #5 from syl20bnr/master

Some other fixes for Windows.
latest commit 65252b4942
@krobertson authored
Failed to load latest commit information.
ernie Fixed bugs on Windows due to stdin and stdout opened in text mode ins…
examples
.gitignore
README.md
setup.py
tests.py

README.md

Python-Ernie

By Ken Robertson (ken@invalidlogic.com)

Python-Ernie is a port of the Ruby-based Ernie server by Tom Preston-Werner. Python-Ernie is the Python server implementation for the BER-RPC specification.

See the full BERT-RPC specification at bert-rpc.org.

Installation

To install Python-Ernie, you can use pip or traditional setup.py:

$ pip install git+git://github.com/krobertson/python-ernie 

pip will install all the dependencies for you which you have to do by yourself when using setup.py directly. This means you need to install the Python port of BERT serializers and Erlastic.

$ git clone git://github.com/samuel/python-erlastic.git
$ sudo python python-erlastic/setup.py install

$ git clone git://github.com/samuel/python-bert.git
$ sudo python python-bert/setup.py install

To install python-ernie itself, run:

$ sudo ./setup.py install

Example Handler

from ernie import mod, start

from ernie import mod, start

def calc_add(a, b):
    return a + b
mod('calc').fun('add', calc_add)

if __name__ == "__main__":
    start()

Contribute

If you'd like to hack on Python-Ernie, start by forking my repo on GitHub:

http://github.com/krobertson/python-ernie

Just create your own fork, hack on it, and then send me a pull request once done.

Todo

I'll be the first to admin I am still new to Python. So if I am way off on best practices in Python, let me know!

  1. Update exception handling to return traceback
  2. Ensure correct handling around read operations
  3. See if I can clean up the way you define your modules
  4. Test

Credits

License

Copyright (c) 2009 Ken Robertson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.