{ "info": { "author": "Russell Keith-Magee", "author_email": "russell@keith-magee.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Java", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development", "Topic :: Software Development :: User Interfaces", "Topic :: Software Development :: Widget Sets" ], "description": "Rubicon-Java\n============\n\nRubicon-Java is a bridge between the Java Runtime Environment and Python.\nIt enables you to:\n\n* Instantiate objects defined in Java,\n* Invoke static and instance methods on objects defined in Java,\n* Access and modify static and instance fields on objects defined in Java, and\n* Write and use Python implementations of interfaces defined in Java.\n\nQuickstart\n----------\n\nRubicon-Java consists of three components:\n\n1. A Python library,\n2. A JNI library, and\n3. A Java JAR file.\n\nA ``Makefile`` has been provided to compile the JNI and JAR components. Type::\n\n $ make\n\nto compile them. The compiled output will be placed in the ``dist`` directory.\n\n.. admonition:: Cross platform support\n\n This Makefile currently only works under OS/X; however, the build commands\n aren't complicated; it should be fairly easy to reproduce the build on other\n platforms. Pull requests to make the ``Makefile`` cross-platform are welcome.\n\nTo use Rubicon-Java, you'll need to ensure:\n\n1. ``rubicon.jar`` is in the classpath when you start your Java VM.\n\n2. The Rubicon library file is somewhere that it will be found by dynamic\n library discovery. This means:\n\n a. Under OS X, put the directory containing ``librubicon.dylib`` is in your ``DYLD_LIBRARY_PATH``\n\n b. Under Linux, put the directory containing ``librubicon.so`` is in your ``LD_LIBRARY_PATH``\n\n c. Under Windows.... something :-)\n\n3. The ``rubicon`` Python module is somewhere that can be added to a\n ``PYTHONPATH``. You can install rubicon using::\n\n $ pip install rubicon-java\n\n If you do this, you'll need to reference your system Python install when\n setting your ``PYTHONPATH``.\n\nThe Rubicon bridge starts on the Java side. Import the Python object::\n\n import org.pybee.rubicon.Python;\n\nThen start the Python interpreter, and run a Python file::\n\n # Initialize the Python VM\n String pythonHome = \"/path/to/python\";\n String pythonPath = \"/path/to/dir1:/path/to/dir2\";\n if (Python.start(pythonHome, pythonPath, null) != 0) {\n System.out.println(\"Error initializing Python VM.\");\n }\n\n # Start a Python script\n if (Python.run(\"/path/to/script.py\") != 0) {\n System.out.println(\"Error running Python script.\");\n }\n\n # Shut down the Python VM.\n Python.stop();\n\nThe ``PYTHONPATH`` you specify must enable access to the ``rubicon`` Python\nmodule.\n\nIn your Python script, you can then reference Java objects::\n\n >>> from rubicon.java import JavaClass\n\n # Wrap a Java class\n >>> URL = JavaClass(\"java/net/URL\")\n\n # Then instantiate the Java class, using the API\n # that is exposed in Java.\n >>> url = URL(\"http://pybee.org\")\n\n # You can then call methods on the Java object as if it\n # were a Python object.\n >>> print url.getHost()\n pybee.org\n\nIt's also possible to provide implementations of Java Interfaces in Python.\nFor example, lets say you want to create a Swing Button, and you want to\nrespond to button clicks::\n\n >>> from rubicon.java import JavaClass, JavaInterface\n\n # Wrap the Java interface\n >>> ActionListener = JavaInterface('java/awt/event/ActionListener')\n\n # Define your own implementation\n >>> class MyActionListener(ActionListener):\n ... def actionPerformed(self, event):\n ... print \"Button Pressed\"\n\n # Instantiate an instance of the listener\n >>> listener = MyActionListener()\n\n # Create a button, and set the listener\n >>> Button = JavaClass('javax/swing/JButton')\n >>> button = Button('Push it')\n >>> button.setActionListener(listener)\n\nOf course, this sample code won't work unless it's in the context of a larger\napplication starting a Swing GUI and so on.\n\nTesting\n-------\n\nTo run the Rubicon test suite:\n\n1. Configure your shell environment so that the Python, Java, and Rubicon\n dynamic libraries can be discovered by the dynamic linker.\n\n * On OSX, using Python 2.7.7 built under Homebrew::\n\n export DYLD_LIBRARY_PATH=/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/:`/usr/libexec/java_home`/jre/lib/server:./dist\n\n2. Build the libraries::\n\n $ make clean\n $ make all\n\n3. Run the test suite::\n\n $ java org.pybee.rubicon.test.Test\n\nThis is a Python test suite, invoked via Java.\n\n.. Documentation\n.. -------------\n\n.. Full documentation for Rubicon can be found on `Read The Docs`_.\n\nCommunity\n---------\n\nRubicon is part of the `BeeWare suite`_. You can talk to the community through:\n\n* `@pybeeware on Twitter`_\n\n* The `BeeWare Users Mailing list`_, for questions about how to use the BeeWare suite.\n\n* The `BeeWare Developers Mailing list`_, for discussing the development of new features in the BeeWare suite, and ideas for new tools for the suite.\n\nContributing\n------------\n\nIf you experience problems with this backend, `log them on GitHub`_. If you\nwant to contribute code, please `fork the code`_ and `submit a pull request`_.\n\n.. _BeeWare suite: http://pybee.org\n.. _Read The Docs: http://rubicon-java.readthedocs.org\n.. _@pybeeware on Twitter: https://twitter.com/pybeeware\n.. _BeeWare Users Mailing list: https://groups.google.com/forum/#!forum/beeware-users\n.. _BeeWare Developers Mailing list: https://groups.google.com/forum/#!forum/beeware-developers\n.. _log them on Github: https://github.com/pybee/rubicon-java/issues\n.. _fork the code: https://github.com/pybee/rubicon-java\n.. _submit a pull request: https://github.com/pybee/rubicon-java/pulls", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pybee.org/rubicon", "keywords": null, "license": "New BSD", "maintainer": null, "maintainer_email": null, "name": "rubicon-java", "package_url": "https://pypi.org/project/rubicon-java/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rubicon-java/", "project_urls": { "Homepage": "http://pybee.org/rubicon" }, "release_url": "https://pypi.org/project/rubicon-java/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "A bridge interface between Python and Java.", "version": "0.1.0" }, "last_serial": 1270744, "releases": { "0.0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9db1141164f1addfacf32beeebcf022d", "sha256": "5a3e96b0ea08d1a728dc61d3b8b8a90458f9474bda62fb9018d3f2d1a9dfb72d" }, "downloads": -1, "filename": "rubicon_java-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9db1141164f1addfacf32beeebcf022d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19203, "upload_time": "2014-10-15T03:25:22", "url": "https://files.pythonhosted.org/packages/9c/5b/b6c01c9cfc7be830d7bb2525f58fa34b93d10067f07c3cfbd28246551d53/rubicon_java-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77382f494b2ad2c41028a68655871912", "sha256": "16787932a9476fdfbff5e7fd4b87343f005e8c96c6b3cc9d27cb1c6ad46e1795" }, "downloads": -1, "filename": "rubicon-java-0.1.0.tar.gz", "has_sig": false, "md5_digest": "77382f494b2ad2c41028a68655871912", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31961, "upload_time": "2014-10-15T03:25:09", "url": "https://files.pythonhosted.org/packages/c3/59/48be86758fc8c0fe566e2cc79630896a45cc4cd4fef56ff411ac53d6f4ba/rubicon-java-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9db1141164f1addfacf32beeebcf022d", "sha256": "5a3e96b0ea08d1a728dc61d3b8b8a90458f9474bda62fb9018d3f2d1a9dfb72d" }, "downloads": -1, "filename": "rubicon_java-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9db1141164f1addfacf32beeebcf022d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19203, "upload_time": "2014-10-15T03:25:22", "url": "https://files.pythonhosted.org/packages/9c/5b/b6c01c9cfc7be830d7bb2525f58fa34b93d10067f07c3cfbd28246551d53/rubicon_java-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77382f494b2ad2c41028a68655871912", "sha256": "16787932a9476fdfbff5e7fd4b87343f005e8c96c6b3cc9d27cb1c6ad46e1795" }, "downloads": -1, "filename": "rubicon-java-0.1.0.tar.gz", "has_sig": false, "md5_digest": "77382f494b2ad2c41028a68655871912", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31961, "upload_time": "2014-10-15T03:25:09", "url": "https://files.pythonhosted.org/packages/c3/59/48be86758fc8c0fe566e2cc79630896a45cc4cd4fef56ff411ac53d6f4ba/rubicon-java-0.1.0.tar.gz" } ] }