Re: [netcdf-java] [thredds] Java to Python tools

I think John is looking for something that would allow C Python to call
into the netCDF-Java libraries.  For that, the two options seem to be:

JPype
JCC

or using interprocess communication. Here's a good presentation on different approaches that I found on the web:

http://www.slideshare.net/onyame/mixing-python-and-java

I think Sean Arms at Unidata was looking at JCC at one point.

Don


On 4/4/12 7:38 AM, stephen.pascoe@xxxxxxxxxx wrote:
The important question is why you need Python.  If it's to access
some C library with python bindings (e.g. numpy or netCDF4-python)
then Jython isn't appropriate and you'll need one of those
Python<->bridges JPype or Jepp.

If you need the very latest Python features (particularly Python 3)
you'll also find Jython is a bit behind CPython.  Many standard
Python frameworks now work with Jython (e.g. Django, SQLAlchemy) but
you'd have to check the compatibility of each dependency.

Otherwise Jython is the most popular and well maintained choice.

Depending on your application you could also wire Java and Python
together using inter-process communication.  There is a plethora of
RPC libraries out there with good Python and Java support.  E.g.
protocol buffers.

Stephen.

--- Stephen Pascoe  +44 (0)1235 445980 Centre of Environmental Data
Archival STFC Rutherford Appleton Laboratory, Harwell Oxford, Didcot
OX11 0QX, UK


-----Original Message----- From: Robert Casey
[mailto:rob@xxxxxxxxxxxxxxxxxxx] Sent: 04 April 2012 14:31 To:
Pascoe, Stephen (STFC,RAL,RALSP); John Caron Cc:
netcdf-java@xxxxxxxxxxxxxxxx; thredds@xxxxxxxxxxxxxxxx Subject: Re:
[thredds] Java to Python tools


Hi John-

If you use Jython, it looks to be pretty seamless.  I am just
starting to develop in Jython, so I can't claim experience in this
department yet.  The first section of this page details Java within
Jython.

http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html

 -Rob


On Apr 4, 2012, at 1:02 AM,<stephen.pascoe@xxxxxxxxxx>  wrote:

Hi John,

Direct experience beyond playing, no; but I've come across several
options:

* Jpype  : http://sourceforge.net/project/jpype -- embeds a JVM in
Python * Jepp   : http://jepp.soureforge.net -- embeds Python
interpreter in Java * Jython : http://www.jython.org -- A Python
implementation in the JVM.

I expect you want Jpype as in your case Python is doing the
wrapping.  I tested it out once and it worked for me.  The project
seems isn't exactly active but it still appears to be in use.

Cheers, Stephen.

--- Stephen Pascoe  +44 (0)1235 445980 Centre of Environmental Data
Archival STFC Rutherford Appleton Laboratory, Harwell Oxford,
Didcot OX11 0QX, UK


-----Original Message----- From: thredds-bounces@xxxxxxxxxxxxxxxx
[mailto:thredds-bounces@xxxxxxxxxxxxxxxx ] On Behalf Of John Caron
Sent: 04 April 2012 00:20 To: Java NetCDF; THREDDS community
Subject: [thredds] Java to Python tools

Hi all:

Anyone have experience with ways to wrap java in Python? We are
thinking about how to solve this issue again.

John

_______________________________________________ thredds mailing
list thredds@xxxxxxxxxxxxxxxx For list information or to
unsubscribe,  visit: http://www.unidata.ucar.edu/mailing_lists/ --
 Scanned by iCritical.

_______________________________________________ thredds mailing
list thredds@xxxxxxxxxxxxxxxx For list information or to
unsubscribe,  visit: http://www.unidata.ucar.edu/mailing_lists/


--
Don Murray
NOAA/ESRL/PSD and CIRES
303-497-3596
http://www.esrl.noaa.gov/psd/people/don.murray/