skip to navigation
skip to content

jtypes.pyjnius 1.1.0b2

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

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

jtypes.pyjnius

Python library for accessing Java classes

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.

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

About PyJNIus:

Note 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

pip install --upgrade jtypes.pyjnius

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

python -m jt.jnius.tests

Prerequisites:

License

Copyright (c) 2014-2017 Adam Karpierz

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

Authors

Changelog

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.
 
File Type Py Version Uploaded on Size
jtypes.pyjnius-1.1.0b2.zip (md5) Source 2017-03-28 72KB