EPC (RPC stack for Emacs Lisp) for Python
=========================================
Links:
* `Documentation <http://python-epc.readthedocs.org/>`_ (at Read the Docs)
* `Repository <https://github.com/tkf/python-epc>`_ (at GitHub)
* `Issue tracker <https://github.com/tkf/python-epc/issues>`_ (at GitHub)
* `PyPI <http://pypi.python.org/pypi/epc>`_
* `Travis CI <https://travis-ci.org/#!/tkf/python-epc>`_ |build-status|
Other resources:
* `kiwanami/emacs-epc <https://github.com/kiwanami/emacs-epc>`_
(Client and server implementation in Emacs Lisp and Perl.)
* `tkf/emacs-jedi <https://github.com/tkf/emacs-jedi>`_
(Python completion for Emacs using EPC server.)
.. |build-status|
image:: https://secure.travis-ci.org/tkf/python-epc.png
?branch=master
:target: http://travis-ci.org/tkf/python-epc
:alt: Build Status
What is this?
-------------
EPC is an RPC stack for Emacs Lisp and Python-EPC is its server side
and client side implementation in Python. Using Python-EPC, you can
easily call Emacs Lisp functions from Python and Python functions from
Emacs. For example, you can use Python GUI module to build widgets
for Emacs (see `examples/gtk/server.py`_ for example).
Python-EPC is tested against Python 2.6, 2.7 and 3.2.
Install
-------
To install Python-EPC and its dependency sexpdata_, run the following
command.::
pip install epc
.. _sexpdata: https://github.com/tkf/sexpdata
Usage
-----
Save the following code as ``my-server.py``.
(You can find functionally the same code in `examples/echo/server.py`_)::
from epc.server import EPCServer
server = EPCServer(('localhost', 0))
@server.register_function
def echo(*a):
return a
server.print_port()
server.serve_forever()
And then run the following code from Emacs.
This is a stripped version of `examples/echo/client.el`_ included in
Python-EPC repository_.::
(require 'epc)
(defvar my-epc (epc:start-epc "python" '("my-server.py")))
(deferred:$
(epc:call-deferred my-epc 'echo '(10))
(deferred:nextc it
(lambda (x) (message "Return : %S" x))))
(message "Return : %S" (epc:call-sync my-epc 'echo '(10 40)))
.. _examples/echo/server.py:
https://github.com/tkf/python-epc/blob/master/examples/echo/server.py
.. _examples/echo/client.el:
https://github.com/tkf/python-epc/blob/master/examples/echo/client.el
If you have carton_ installed, you can run the above sample by
simply typing the following commands::
make elpa # install EPC in a separated environment
make run-sample # run examples/echo/client.el
.. _carton: https://github.com/rejeep/carton
For example of bidirectional communication and integration with GTK,
see `examples/gtk/server.py`_. You can run this example by::
make elpa
make run-gtk-sample # run examples/gtk/client.el
.. _examples/gtk/server.py:
https://github.com/tkf/python-epc/blob/master/examples/gtk/server.py
License
-------
Python-EPC is licensed under GPL v3.
See COPYING for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/tkf/python-epc",
"name": "epc",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Emacs,RPC",
"author": "Takafumi Arakaki",
"author_email": "aka.tkf@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/55/ae/f7b329fa2bc9932a416e8846e78e06ce3e13a20e5c3f2cf80a18f489dec1/epc-0.0.5.tar.gz",
"platform": "UNKNOWN",
"description": "EPC (RPC stack for Emacs Lisp) for Python\n=========================================\n\nLinks:\n\n* `Documentation <http://python-epc.readthedocs.org/>`_ (at Read the Docs)\n* `Repository <https://github.com/tkf/python-epc>`_ (at GitHub)\n* `Issue tracker <https://github.com/tkf/python-epc/issues>`_ (at GitHub)\n* `PyPI <http://pypi.python.org/pypi/epc>`_\n* `Travis CI <https://travis-ci.org/#!/tkf/python-epc>`_ |build-status|\n\nOther resources:\n\n* `kiwanami/emacs-epc <https://github.com/kiwanami/emacs-epc>`_\n (Client and server implementation in Emacs Lisp and Perl.)\n* `tkf/emacs-jedi <https://github.com/tkf/emacs-jedi>`_\n (Python completion for Emacs using EPC server.)\n\n.. |build-status|\n image:: https://secure.travis-ci.org/tkf/python-epc.png\n ?branch=master\n :target: http://travis-ci.org/tkf/python-epc\n :alt: Build Status\n\n\nWhat is this?\n-------------\n\nEPC is an RPC stack for Emacs Lisp and Python-EPC is its server side\nand client side implementation in Python. Using Python-EPC, you can\neasily call Emacs Lisp functions from Python and Python functions from\nEmacs. For example, you can use Python GUI module to build widgets\nfor Emacs (see `examples/gtk/server.py`_ for example).\n\nPython-EPC is tested against Python 2.6, 2.7 and 3.2.\n\nInstall\n-------\n\nTo install Python-EPC and its dependency sexpdata_, run the following\ncommand.::\n\n pip install epc\n\n.. _sexpdata: https://github.com/tkf/sexpdata\n\n\nUsage\n-----\n\nSave the following code as ``my-server.py``.\n(You can find functionally the same code in `examples/echo/server.py`_)::\n\n from epc.server import EPCServer\n\n server = EPCServer(('localhost', 0))\n\n @server.register_function\n def echo(*a):\n return a\n\n server.print_port()\n server.serve_forever()\n\n\nAnd then run the following code from Emacs.\nThis is a stripped version of `examples/echo/client.el`_ included in\nPython-EPC repository_.::\n\n (require 'epc)\n\n (defvar my-epc (epc:start-epc \"python\" '(\"my-server.py\")))\n\n (deferred:$\n (epc:call-deferred my-epc 'echo '(10))\n (deferred:nextc it\n (lambda (x) (message \"Return : %S\" x))))\n\n (message \"Return : %S\" (epc:call-sync my-epc 'echo '(10 40)))\n\n\n.. _examples/echo/server.py:\n https://github.com/tkf/python-epc/blob/master/examples/echo/server.py\n.. _examples/echo/client.el:\n https://github.com/tkf/python-epc/blob/master/examples/echo/client.el\n\nIf you have carton_ installed, you can run the above sample by\nsimply typing the following commands::\n\n make elpa # install EPC in a separated environment\n make run-sample # run examples/echo/client.el\n\n.. _carton: https://github.com/rejeep/carton\n\n\nFor example of bidirectional communication and integration with GTK,\nsee `examples/gtk/server.py`_. You can run this example by::\n\n make elpa\n make run-gtk-sample # run examples/gtk/client.el\n\n.. _examples/gtk/server.py:\n https://github.com/tkf/python-epc/blob/master/examples/gtk/server.py\n\n\nLicense\n-------\n\nPython-EPC is licensed under GPL v3.\nSee COPYING for details.",
"bugtrack_url": null,
"license": "GNU General Public License v3 (GPLv3)",
"summary": "EPC (RPC stack for Emacs Lisp) implementation in Python",
"version": "0.0.5",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/tkf/python-epc"
},
"split_keywords": [
"emacs",
"rpc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "55aef7b329fa2bc9932a416e8846e78e06ce3e13a20e5c3f2cf80a18f489dec1",
"md5": "de54a24ace8a9b3f5b2d8f014b8c4a42",
"sha256": "a14d2ea74817955a20eb00812e3a4630a132897eb4d976420240f1152c0d7d25"
},
"downloads": -1,
"filename": "epc-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "de54a24ace8a9b3f5b2d8f014b8c4a42",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17968,
"upload_time": "2013-06-22T19:14:18",
"upload_time_iso_8601": "2013-06-22T19:14:18.999355Z",
"url": "https://files.pythonhosted.org/packages/55/ae/f7b329fa2bc9932a416e8846e78e06ce3e13a20e5c3f2cf80a18f489dec1/epc-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2013-06-22 19:14:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tkf",
"github_project": "python-epc",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "epc"
}