Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vbuell/python-javaobj
python-javaobj is a python library that provides functions for reading of Java objects serialized ObjectOutputStream.
https://github.com/vbuell/python-javaobj
Last synced: 28 days ago
JSON representation
python-javaobj is a python library that provides functions for reading of Java objects serialized ObjectOutputStream.
- Host: GitHub
- URL: https://github.com/vbuell/python-javaobj
- Owner: vbuell
- License: apache-2.0
- Created: 2015-03-21T14:00:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-21T14:22:17.000Z (almost 10 years ago)
- Last Synced: 2023-04-03T18:47:21.429Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 223 KB
- Stars: 13
- Watchers: 0
- Forks: 8
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-javaobj
python-javaobj is a python library that provides functions for reading and writing (writing is WIP currently) Java objects
serialized or will be deserialized by _ObjectOutputStream_. This form of object
representation is a standard data interchange format in Java world.javaobj module exposes an API familiar to users of the standard library marshal, pickle and json modules.
## Features
* Java object instance unmarshaling
* Java classes unmarshaling
* Primitive values unmarshaling
* Automatic conversion of Java Collections to python ones (_HashMap_ => dict, _ArrayList_ => list, etc)
## Requirements* Python >= 2.6, but < 3.0 (porting to 3.0 is in progress)
* Maven 2+ (for building test data of serialized objects. You can skip it if you do not plan to run tests.py)## Usage
Unmarshalling of Java serialised object:
```python
import javaobjjobj = self.read_file("obj5.ser")
pobj = javaobj.loads(jobj)
print pobj
```Or, you can use Unmarshaller object directly:
```python
import javaobjmarshaller = javaobj.JavaObjectUnmarshaller(open("sunExample.ser"))
pobj = marshaller.readObject()self.assertEqual(pobj.value, 17)
self.assertTrue(pobj.next)pobj = marshaller.readObject()
```