GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jbrette/java2python: Simple but effective library to translate Java source code to Python.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

221 Commits
221 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude-plugin
.claude-plugin
 
 
bin
bin
 
 
doc
doc
 
 
java2python
java2python
 
 
plugin
plugin
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.python-version
.python-version
 
 
CLAUDE.md
CLAUDE.md
 
 
license.txt
license.txt
 
 
pyproject.toml
pyproject.toml
 
 
readme.md
readme.md
 
 
uv.lock
uv.lock
 
 

Repository files navigation

java2python

Simple but effective tool to translate Java source code into Python.

The java2python package can translate any syntactically valid Java source code file. The generated Python code is not guaranteed to run, nor is guaranteed to be syntactically valid Python. However, java2python works well many cases, and in some of those, it creates perfectly usable and workable Python code.

The generated code targets Python 3.14+, and java2python itself requires Python 3.14+. For more information, read the introduction. To install (with uv), refer to the installation page.

There are lots of docs, plenty of tests, and many options for controlling code generation.

If you're looking for old releases, check the downloads link above.

Here's a very simple example:

$ cat HelloWorld.java
// This is the HelloWorld class with a single method.
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, world.");
    }
}

Next we run our program:

$ uv run j2py HelloWorld.java
#!/usr/bin/env python3
""" generated source for module HelloWorld """
#  This is the HelloWorld class with a single method.
class HelloWorld:
    """ generated source for class HelloWorld """
    @classmethod
    def main(cls, args):
        """ generated source for method main """
        print("Hello, world.")


if __name__ == '__main__':
    import sys
    HelloWorld.main(sys.argv)

About

Simple but effective library to translate Java source code to Python.

Resources

Readme
LGPL-2.1 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.