According the the quote you gave from the documentation, the API uses TCP. You can access this with any networking library in any language, including Python.

To start, you will need to learn the basics of TCP. A google search will lead you to the technical documentation. An RFC gives the official specification. Then you will need a Python library to open a network connection and send binary data. Finally, you will need to read the documentation for the API.

Answer from Code-Apprentice on Stack Overflow
🌐
Py4j
py4j.org
Welcome to Py4J β€” Py4J
Py4J enables Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. Methods are called as if the Java objects resided in the Python interpreter and Java collections can be accessed through standard Python collection methods.
🌐
Medium
konstantinmb.medium.com β€Ί exploring-java-and-python-for-api-development-which-is-right-for-you-e23cadce230b
Exploring Java and Python for API Development: Which Is Right for You? | by Konstantin Borimechkov | Medium
November 3, 2023 - While Python enjoys broader usage in the industry as a whole, when it comes to API development, Java still holds its ground as the most in-demand language. Most medium to large tech companies rely extensively on Java for their API development ...
Discussions

Using python to access JAVA API? - Stack Overflow
I have written a python scripts which get data from various sources(Quandl, webscraping etc) at the moment. I want to switch to a more stable information feed, order placement system. The broker pr... More on stackoverflow.com
🌐 stackoverflow.com
Accessing Java API information with Python - Stack Overflow
I'm looking for a very simple way, from Python, to get information about Java classes: name of the class what it extends and implements methods with returns types and parameters attributes with type More on stackoverflow.com
🌐 stackoverflow.com
November 8, 2011
Calling Java from Python - Stack Overflow
What is the best way to call java from python? (jython and RPC are not an option for me). I've heard of JCC: http://pypi.python.org/pypi/JCC/1.9 a C++ code generator for calling Java from C++/Pytho... More on stackoverflow.com
🌐 stackoverflow.com
Using a java library from python - Stack Overflow
As opposed to Jython, Py4J runs ... of Python and you can use libraries that do not run well on Jython (e.g., lxml). The communication is done through sockets instead of JNI. ... Sign up to request clarification or add additional context in comments. ... Hi, Barthelemy. Could you tell me if I can use you solution to work with EJBCA API? 2013-02-21T08:15:02.863Z+00:00 ... I am trying to use py4j to load a java object (in ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Chaquo
chaquo.com β€Ί chaquopy β€Ί doc β€Ί current β€Ί java.html
Java API - Chaquopy 16.1
The Java API provides facilities to use Python classes and objects from Java code.
🌐
Jython
jython.org
Home | Jython
Bug tracker Github Legacy Mailing List Developer Guide Jython 3 Features (MVP) Jython 3 Roadmap Jython 3 (snapshot) on APIdia Website source Links Β· The Jython project provides implementations of Python in Java, providing to Python the benefits of running on the JVM and access to classes written ...
🌐
Baeldung
baeldung.com β€Ί home β€Ί java β€Ί how to call python from java
How to Call Python From Java | Baeldung
August 27, 2025 - In this section, we’ll take a look at two different options we can use to invoke our Python script using core Java. Let’s first take a look at how we can use the ProcessBuilder API to create a native operating system process to launch python and execute our simple script:
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί java β€Ί integrating-java-with-python
Integrating Java with Python - GeeksforGeeks
July 23, 2025 - Packages like Py4j, Pyjnius, Jpype, javabridge, and JCC help invoke Java programs from Python. Also, since Java provides a wide variety of collections, we can directly use them in a Python program by including their java packages in the program.
🌐
GeoAPI
geoapi.org β€Ί java-python
Bridge between Java and Python API
May 5, 2025 - The GeoAPI Java ↔ Python bridge also requires JPY, a bi-directional bridge used to embed Java in CPython or the other way round. JPY has been designed particularly with regard to maximum data transfer speed between the two languages. This page explains how to build JPY locally.
🌐
CodeConvert AI
codeconvert.ai β€Ί java-to-python-converter
Free Java to Python Converter β€” AI Code Translation | CodeConvert AI
Instantly convert Java to Python code with AI. Free, fast, and accurate code translation β€” 60+ languages supported, no signup required.
Top answer
1 of 12
116

Jython: Python for the Java Platform - http://www.jython.org/index.html

You can easily call python functions from Java code with Jython. That is as long as your python code itself runs under jython, i.e. doesn't use some c-extensions that aren't supported.

If that works for you, it's certainly the simplest solution you can get. Otherwise you can use org.python.util.PythonInterpreter from the new Java6 interpreter support.

A simple example from the top of my head - but should work I hope: (no error checking done for brevity)

PythonInterpreter interpreter = new PythonInterpreter();
interpreter.exec("import sys\nsys.path.append('pathToModules if they are not there by default')\nimport yourModule");
// execute a function that takes a string and returns a string
PyObject someFunc = interpreter.get("funcName");
PyObject result = someFunc.__call__(new PyString("Test!"));
String realResult = (String) result.__tojava__(String.class);

As of 2021, Jython does not support Python 3.x

2 of 12
77

I think there are some important things to consider first with how strong you wish to have the linking between Java and Python.

Firstly Do you only want to call functions or do you actually want Python code to change the data in your java objects? This is very important. If you only want to call some Python code with or without arguments, then that is not very difficult. If your arguments are primitives it makes it even more easy. However, if you want to have Java class implement member functions in Python, which change the data of the Java object, then this is not so easy or straight forward.

Secondly are we talking CPython, or will Jython do? I would say CPython is where its at! I would advocate this is why Python is so kool! Having such high abstractions however access to C or C++ when needed. Imagine if you could have that in Java. This question is not even worth asking if Jython is ok because then it is easy anyway.

So I have played with the following methods, and listed them from easy to difficult:

Java to Jython

Advantages: Trivially easy. Have actual references to Java objects

Disadvantages: No CPython, Extremely Slow!

Jython from Java is so easy, and if this is really enough then great. However it is very slow and no CPython! Is life worth living without CPython? I don't think so! You can easily have Python code implementing your member functions for you Java objects.

Java to Jython to CPython via Pyro

Pyro is the remote object module for Python. You have some object on a CPython interpreter, and you can send it objects which are transferred via serialization and it can also return objects via this method. Note that if you send a serialized Python object from Jython and then call some functions which change the data in its members, then you will not see those changes in Java. You just need to remember to send back the data which you want from Pyro. This, I believe, is the easiest way to get to CPython! You do not need any JNI or JNA or SWIG or .... You don't need to know any C, or C++. Kool huh?

Advantages:

  • Access to CPython
  • Not as difficult as following methods

Disadvantages:

  • Cannot change the member data of Java objects directly from Python
  • Is somewhat indirect (Jython is middle man)

Java to C/C++ via JNI/JNA/SWIG to Python via Embedded interpreter (maybe using BOOST Libraries?)

OMG this method is not for the faint of heart. And I can tell you it has taken me very long to achieve this in with a decent method. Main reason you would want to do this is so that you can run CPython code which as full rein over you java object. There are major things to consider before deciding to try and breed Java (which is like a chimp) with Python (which is like a horse). Firstly if you crash the interpreter, that's lights out for you program! And don't get me started on concurrency issues! In addition, there is a lot of boiler, I believe I have found the best configuration to minimize this boiler but it is still a lot! So how to go about this: Consider that C++ is your middle man, your objects are actually C++ objects! Good that you know that now. Just write your object as if your program is in C++ and not Java, with the data you want to access from both worlds. Then you can use the wrapper generator called SWIG to make this accessible to java and compile a dll which you call (System.load(dllNameHere)) in Java. Get this working first, then move on to the hard part! To get to Python you need to embed an interpreter. Firstly I suggest doing some hello interpreter programs or this tutorial Embedding Python in C/C. Once you have that working, its time to make the horse and the monkey dance! You can send you C++ object to Python via [boost][3] . I know I have not given you the fish, merely told you where to find the fish. Some pointers to note for this when compiling.

When you compile boost you will need to compile a shared library. And you need to include and link to the stuff you need from jdk, ie jawt.lib, jvm.lib, (you will also need the client jvm.dll in your path when launching the application) As well as the python27.lib or whatever and the boost_python-vc100-mt-1_55.lib. Then include Python/include, jdk/include, boost and only use shared libraries (dlls) otherwise boost has a teary. And yeah full on I know. There are so many ways in which this can go sour. So make sure you get each thing done block by block. Then put them together.

🌐
AskPython
askpython.com β€Ί home β€Ί how to call java using python with jpype and pyjnius
Calling Java using Python | #1 guide to Jpype
November 8, 2023 - #1 Guide to learn how to use Jpype1 and Pyjnius to Call Java using Python by making use of JPype1 and Pyjnius in Python.
🌐
Readthedocs
jpy.readthedocs.io
Welcome to jpy’s documentation! β€” jpy 0.9.0 documentation
jpy is a bi-directional Java-Python bridge allowing you to call Java from Python and Python from Java.
🌐
Quora
quora.com β€Ί Which-is-better-for-API-Java-or-Python
Which is better for API, Java or Python? - Quora
Answer (1 of 2): My choice would be Python any day of the week and twice on Sundays. I admit that it’s a choice made out of ignorance since I have never coded an API specifically in Java but I have seen enough Java to know it’s not pleasant programming. Using Flask or Django-rest-framework is rel...
🌐
Reddit
reddit.com β€Ί r/java β€Ί best way to combine python and java?
r/java on Reddit: Best way to combine Python and Java?
October 29, 2022 -

My project uses some packages that are available only in Python and heavily rely on C libraries. The project also greatly benefits from Java libraries and the JVM. What's the optimal way to call Python functions from Java?

I tried:

  1. Small web-services: overhead to serialize data, start and stop the services. Also debugging is harder and implementing each new function is now double the effort.

  2. Jpy: a library that runs an interpreter in the JVM. Spare the service start/stop, but: isn't really feasible for more than a single-liner, data translation between Java and Python is cumbersome, and I also encountered runtime segmentation fault errors.

Any other options?

The project is in the machine-learning domain, so involves exchanging large numeric arrays and text. In some cases the execution switches back and forth between the platforms.

🌐
Medium
medium.com β€Ί @chamlinid β€Ί integrate-java-and-python-code-bases-1c4819fe19da
Integrate Java and Python code bases | by Chamlini Dayathilake | Medium
February 14, 2025 - In addition to the method explained in this story of using ProcessBuilder, someone can use Jython or RestAPIs using Flask to integrate Python with Java. But the drawback is Jython does not support machine learning libraries of Python, so that we cannot use Jython for this purpose.
🌐
Quora
quora.com β€Ί Where-can-you-learn-to-connect-API-to-Java-or-Python
Where can you learn to connect API to Java or Python? - Quora
Answer (1 of 2): How to connect API to Java or Python (Beginner’s Guide) Nowadays, Python is one of the most popular and accessible programming languages. In 2019 it was ranked third in the TIOBE rating. Many experts believe that in 3-4 years it will overtake C and Java to lead the ratings. Bas...
🌐
Deephaven
deephaven.io β€Ί core β€Ί docs β€Ί how-to-guides β€Ί use-jpy
Use jpy | Deephaven
jpy is a bi-directional Java-Python bridge that facilitates calling Java from Python and vice versa. Python programs that use jpy can access Java functionalitie...