OT: calling Java from Python

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OT: calling Java from Python

Chris Barker - NOAA Federal
Hi folks,

This is a bit OT, but y'all tend to be a great resource for lots of
stuff, and this is python-for-science related:

Are there any active projects supporting calling Java from CPython?

It seems JPE and JPype are both pretty dead, and I don't see much else
except maybe Babel:

https://computation.llnl.gov/casc/components/#page=home

  -- thought that seems kind of like yet another language!)

My use case:

Lately Unidata has put a lot more emphasis on the JAVA implementation of
the netcdf libraries that the C one, so it has a lot of nifty features
not supported for C, and therefore for Python.

There is this project for calling the netcdf JAVA libs from MATLAB:

http://sourceforge.net/apps/trac/njtbx

Which made me think that it would be nice to have something similar for
Python. With the Python C api and JNI (and maybe Cython), it should be
possible, but I sure don't want to start doing that from scratch.

gnu CNI looks promising, too.


There is a lot going on in the JAVA world, it would be nice to access
some of that.

Are any of you doing anything like this? Any thoughts? There


-Chris




--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: OT: calling Java from Python

Christoph Gohlke


On 12/23/2010 12:49 PM, Christopher Barker wrote:

> Hi folks,
>
> This is a bit OT, but y'all tend to be a great resource for lots of
> stuff, and this is python-for-science related:
>
> Are there any active projects supporting calling Java from CPython?
>
> It seems JPE and JPype are both pretty dead, and I don't see much else
> except maybe Babel:
>
> https://computation.llnl.gov/casc/components/#page=home
>
>    -- thought that seems kind of like yet another language!)
>
> My use case:
>
> Lately Unidata has put a lot more emphasis on the JAVA implementation of
> the netcdf libraries that the C one, so it has a lot of nifty features
> not supported for C, and therefore for Python.
>
> There is this project for calling the netcdf JAVA libs from MATLAB:
>
> http://sourceforge.net/apps/trac/njtbx
>
> Which made me think that it would be nice to have something similar for
> Python. With the Python C api and JNI (and maybe Cython), it should be
> possible, but I sure don't want to start doing that from scratch.
>
> gnu CNI looks promising, too.
>
>
> There is a lot going on in the JAVA world, it would be nice to access
> some of that.
>
> Are any of you doing anything like this? Any thoughts? There
>
>
> -Chris
>
>

CellProfiler <http://www.cellprofiler.org/> calls Java libraries
(bioformats, ImageJ) via JNI. Take a look at
<https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/utilities/javabridge.pyx>.

--
Christoph
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: OT: calling Java from Python

josef.pktd
On Thu, Dec 23, 2010 at 4:00 PM, Christoph Gohlke <[hidden email]> wrote:

>
>
> On 12/23/2010 12:49 PM, Christopher Barker wrote:
>> Hi folks,
>>
>> This is a bit OT, but y'all tend to be a great resource for lots of
>> stuff, and this is python-for-science related:
>>
>> Are there any active projects supporting calling Java from CPython?
>>
>> It seems JPE and JPype are both pretty dead, and I don't see much else
>> except maybe Babel:
>>
>> https://computation.llnl.gov/casc/components/#page=home
>>
>>    -- thought that seems kind of like yet another language!)
>>
>> My use case:
>>
>> Lately Unidata has put a lot more emphasis on the JAVA implementation of
>> the netcdf libraries that the C one, so it has a lot of nifty features
>> not supported for C, and therefore for Python.
>>
>> There is this project for calling the netcdf JAVA libs from MATLAB:
>>
>> http://sourceforge.net/apps/trac/njtbx
>>
>> Which made me think that it would be nice to have something similar for
>> Python. With the Python C api and JNI (and maybe Cython), it should be
>> possible, but I sure don't want to start doing that from scratch.
>>
>> gnu CNI looks promising, too.
>>
>>
>> There is a lot going on in the JAVA world, it would be nice to access
>> some of that.
>>
>> Are any of you doing anything like this? Any thoughts? There
>>
>>
>> -Chris
>>
>>
>
> CellProfiler <http://www.cellprofiler.org/> calls Java libraries
> (bioformats, ImageJ) via JNI. Take a look at
> <https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/utilities/javabridge.pyx>.


http://pypi.python.org/pypi/JCC/2.7

Josef

>
> --
> Christoph
> _______________________________________________
> SciPy-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: OT: calling Java from Python

Chris Barker - NOAA Federal
In reply to this post by Christoph Gohlke
> On 12/23/2010 12:49 PM, Christopher Barker wrote:
>> Are there any active projects supporting calling Java from CPython?

I found a bit more on my own, plus got some helpful replies, so here's a
summary:

On 12/23/10 1:00 PM, Christoph Gohlke wrote:
> CellProfiler<http://www.cellprofiler.org/>  calls Java libraries
> (bioformats, ImageJ) via JNI. Take a look at
> <https://svn.broadinstitute.org/CellProfiler/trunk/CellProfiler/cellprofiler/utilities/javabridge.pyx>.

That does look like a good starting point -- it kind of looks like
javabridge is its own project, but couldn't find independent references
to it. But certainly a good place to start. if I wanted to do that sort
of thing.



GNU CNI:
http://gcc.gnu.org/onlinedocs/gcj/About-CNI.html#About-CNI

This looks like a good way to call JAVA from C++, and therefore would be
pretty easy to leverage for calling JAVA from Cython, for example.

It would also provide the advantage of not having to have it rely on a
particular JVM being installed -- you could deliver the gcj runtime
along with your binaries.


On 12/23/10 2:00 PM, [hidden email] wrote:

 > JCC 2.7: a C++ code generator for calling Java from C++/Python
> http://pypi.python.org/pypi/JCC/2.7

Ah -- very nice -- I should have thought to search Pypi directly!

That does look to be pretty much exactly what I'm looking for.


-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]
_______________________________________________
SciPy-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/scipy-user