ANN: java2python 0.2

T

Troy Melhase

java2python - Java to Python Source Code Translator
---------------------------------------------------
java2python 0.2 Released 18 February 2007


What is java2python?
------------------------------------------------------------------------------
java2python is a simple but effective tool to translate Java source code into
Python source code. It's not perfect, and does not aspire to be.


What's new in this release?
------------------------------------------------------------------------------
Small enhancement: added converstion of "public static void main" method into
module "if __name__ == '__main__' block.

Better classmethod support: fixed class/instance member formatting strings to
account for classmethods.

Slightly more pythonic: replace "x == None" expressions with "x is None" in
output code, also replace "x != None" with "x is not None".

Bugfix: Fixed dotted type identifiers.

Better exception translation: added support for mapping java exception types
to python exception types.

Support for non-local base class members: added support for base class
members via config modules.

Bugfix: changed single % characters to %% in expression format strings.

Small enhancement: added support for 'methodPreambleSorter' configuration
item. With this value, config modules can specify how to sort method
preambles (typically decorators).


Where can I get java2python?
------------------------------------------------------------------------------
java2python is available for download from Google code:

http://code.google.com/p/java2python/downloads/list

Project page:

http://code.google.com/p/java2python/


How do I use java2python?
------------------------------------------------------------------------------
Like this:

$ j2py -i input_file.java -o output_file.py

The command has many options, and supports customization via multiple
configuration modules.


What are the requirements?
------------------------------------------------------------------------------
java2python requires Python 2.5 or newer. Previous versions may or may not
work. java2python requires ANTLR and PyANTLR to translate code, but
translated code does not require ANTLR.


What else?
------------------------------------------------------------------------------
java2python is installed with distutils. Refer to the Python distutils
documentation for more information. The digest version is:

$ tar xzf java2python-0.2.tar.gz
$ cd java2python-0.2
$ python setup.py install

java2python is licensed under the GNU General Public License 2.0. No license
is assumed of (or applied to) translated source.

I'm very interested in your experience with java2python. Please drop me an
note with any feedback you have.

Troy Melhase
mailto:[email protected]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.2 (GNU/Linux)

iD8DBQBF2SnD7BSNUfV28VARAoXGAJ46JfLx4rdxd+ntv71SjptjvErEeACaAnzB
e69OrvYhI9IKweFKBTwDNS0=
=fful
-----END PGP SIGNATURE-----
 
K

Kay Schluehr

java2python - Java to Python Source Code Translator
---------------------------------------------------
java2python 0.2 Released 18 February 2007

What is java2python?
------------------------------------------------------------------------------
java2python is a simple but effective tool to translate Java source code into
Python source code. It's not perfect, and does not aspire to be.

What's new in this release?
------------------------------------------------------------------------------
Small enhancement: added converstion of "public static void main" method into
module "if __name__ == '__main__' block.

Better classmethod support: fixed class/instance member formatting strings to
account for classmethods.

Slightly more pythonic: replace "x == None" expressions with "x is None" in
output code, also replace "x != None" with "x is not None".

Bugfix: Fixed dotted type identifiers.

Better exception translation: added support for mapping java exception types
to python exception types.

Support for non-local base class members: added support for base class
members via config modules.

Bugfix: changed single % characters to %% in expression format strings.

Small enhancement: added support for 'methodPreambleSorter' configuration
item. With this value, config modules can specify how to sort method
preambles (typically decorators).

Where can I get java2python?
------------------------------------------------------------------------------
java2python is available for download from Google code:

http://code.google.com/p/java2python/downloads/list

Project page:

http://code.google.com/p/java2python/

How do I use java2python?
------------------------------------------------------------------------------
Like this:

$ j2py -i input_file.java -o output_file.py

The command has many options, and supports customization via multiple
configuration modules.

What are the requirements?
------------------------------------------------------------------------------
java2python requires Python 2.5 or newer. Previous versions may or may not
work. java2python requires ANTLR and PyANTLR to translate code, but
translated code does not require ANTLR.

What else?
------------------------------------------------------------------------------
java2python is installed with distutils. Refer to the Python distutils
documentation for more information. The digest version is:

$ tar xzf java2python-0.2.tar.gz
$ cd java2python-0.2
$ python setup.py install

java2python is licensed under the GNU General Public License 2.0. No license
is assumed of (or applied to) translated source.

I'm very interested in your experience with java2python. Please drop me an
note with any feedback you have.

Troy Melhase
mailto:[email protected]

application_pgp-signature_part
1KHerunterladen


Hi Troy. What is the rationale for your project?
 
T

Troy Melhase

Hi Troy. What is the rationale for your project?

Hi Kay,

I maintain a python port of a java library. It finally got too
complicated to do by hand, so I wrote java2python to make my life
easier. I wrote more extensively about the library and this tool in
my blog:

http://blog.melhase.net/articles/2007/02/15/automated-translation-of-java-to-python

I haven't documented the tool and all of it's configuration options in
detail; please let me know if I can explain something further.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top