Skip to main content

Dynamic access to Java classes from Python (ctypes/cffi-based PyJNIus)

Project description

Currently only as placeholder (because a base package jtypes.jvm is still in development)

jtypes.pyjnius

Dynamic access to Java classes from Python.

Overview

jtypes.pyjnius is a bridge between Python and Java, allowing these to intercommunicate.
It is an effort to allow python programs full access to Java class libraries.

PyPI record.

jtypes.pyjnius is a lightweight Python package, based on the ctypes or cffi library.
It is an almost fully compliant implementation of Kivy Team’s PyJNIus package by reimplementing whole its functionality in a clean Python instead of Cython.

About PyJNIus:

Borrowed from the original website:

PyJNIus is a Python library for accessing Java classes.

A minimal PyJNIus example looks something like this:

Quick overview

>>> from jnius import autoclass
>>> System = autoclass('java.lang.System')
>>> System.out.println('Hello world')
Hello world

>>> Stack = autoclass('java.util.Stack')
>>> stack = Stack()
>>> stack.push('hello')
>>> stack.push('world')
>>> print(stack.pop())
world
>>> print(stack.pop())
hello

Requirements

  • Either the Sun/Oracle JRE/JDK or OpenJDK.

Installation

Prerequisites:

To install run:

python -m pip install --upgrade jtypes.pyjnius

To ensure everything is running correctly you can run the tests using:

python -m jt.jnius.tests

Development

Visit development page

Installation from sources:

Clone the sources and run:

python -m pip install ./jtypes.pyjnius

or on development mode:

python -m pip install --editable ./jtypes.pyjnius

Prerequisites:

  • Development is strictly based on tox. To install it run:

    python -m pip install tox

License

Copyright (c) 2014-2018 Adam Karpierz

Licensed under the MIT License
Please refer to the accompanying LICENSE file.

Authors

Changelog

1.1.4b4 (2018-11-08)

  • Synchro with pyjnius master branch.

  • Update of the required setuptools version.

  • Minor setup and tests improvements.

1.1.4b0 (2018-10-26)

  • Synchro with pyjnius master branch.

1.1.2b4 (2018-05-23)

  • Bug fixes in jnius_config.

  • Synchro with pyjnius master branch.

1.1.2b3 (2018-05-22)

  • Update of the required setuptools version.

1.1.2b2 (2018-02-26)

  • Improvement and simplification of setup and packaging.

1.1.2b1 (2018-01-29)

  • Development moved to github.

  • General improvements and update.

1.1.2a0 (2017-04-01)

  • Development version.

1.1.0b2 (2017-01-21)

  • Documentation update.

1.1.0b1 (2017-01-01)

  • First beta release.

1.1.0a1 (2014-11-30)

  • Initial version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jtypes.pyjnius-1.1.4b4.zip (70.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page