Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
net.razorvine:pyrolite
Advanced tools
This library allows your Java program to interface very easily with the Python world. It uses the Pyro protocol to call methods on remote objects. (See https://pyro5.readthedocs.io/). Pyrolite only implements part of the client side Pyro library, hence its name 'lite'... So if you don't need Pyro's full feature set, Pyrolite may be a good choice to connect java or .NET and python. Version 5.0 changes: support Pyro5 wire protocol. Dropped support of Pyro4 (stick to version 4.xx for that).
Pyrolite is written by Irmen de Jong (irmen@razorvine.net).
This software is distributed under the terms written in the file LICENSE
.
This library allows your Java or .NET program to interface very easily with a Python program, using the Pyro protocol to call methods on remote objects (see https://github.com/irmen/Pyro5).
Pyrolite only implements a part of the client side Pyro library, hence its name 'lite'... For the full Pyro experience (and the ability to host servers and expose these via Pyro) you have to run Pyro itself in Python. But if you don't need Pyro's full feature set, and don't require your Java/.NET code to host Pyro objects but rather only call them, Pyrolite could be a good choice to connect Java or .NET and Python!
If you are still using Pyro4 and want to use Pyrolite with it, you should stick to an older version of this library (versions 4.xx). The current 5.xx version only supports Pyro5.
In Github, use the pyro4-legacy
branch.
Precompiled libraries are available:
net.razorvine
artifact id pyrolite
.Some Java example code:
import net.razorvine.pyro.*;
NameServerProxy ns = NameServerProxy.locateNS(null);
PyroProxy remoteobject = new PyroProxy(ns.lookup("Your.Pyro.Object"));
Object result = remoteobject.call("pythonmethod", 42, "hello", new int[]{1,2,3});
String message = (String)result; // cast to the type that 'pythonmethod' returns
System.out.println("result message="+message);
remoteobject.close();
ns.close();
Some C# example code:
using Razorvine.Pyro;
using( NameServerProxy ns = NameServerProxy.locateNS(null) )
{
// this uses the statically typed proxy class:
using( PyroProxy something = new PyroProxy(ns.lookup("Your.Pyro.Object")) )
{
object result = something.call("pythonmethod", 42, "hello", new int[]{1,2,3});
string message = (string)result; // cast to the type that 'pythonmethod' returns
Console.WriteLine("result message="+message);
result = something.getattr("remote_attribute");
Console.WriteLine("remote attribute="+result);
}
// but you can also use it as a dynamic!
using( dynamic something = new PyroProxy(ns.lookup("Your.Pyro.Object")) )
{
object result = something.pythonmethod(42, "hello", new int[]{1,2,3});
string message = (string)result; // cast to the type that 'pythonmethod' returns
Console.WriteLine("result message="+message);
result = something.remote_attribute;
Console.WriteLine("remote attribute="+result);
}
}
More examples can be found in the examples directory. You could also study the unit tests.
Until version 5.0, Pyrolite included a pickle protocol implementation that allowed your Java or .NET code to read and write Python pickle files (pickle is Python's serialization format). From 5.0 onwards, this is no longer included because Pyro5 no longer uses pickle.
If you still want to read or write pickled data, have a look at the now separate pickle library: https://github.com/irmen/pickle
The serializer used is 'serpent' (a special serilization protocol that I designed for the Pyro library)
So this requires the Razorvine.Serpent
assembly (.NET)
or the net.razorvine
serpent
artifact (serpent.jar, Java) to be available.
Serpent is a separate project (als by me), you'll have to install this dependency yourself. You can find it at: https://github.com/irmen/Serpent Download instructions are there as well.
Pyrolite also maps Python exceptions that may occur in the remote object. It has a rather simplistic approach:
all exceptions, including the Pyro ones (Pyro4.errors.*), are converted to
PyroException
objects. PyroException
is a normal Java or C# exception type,
and it will be thrown as a normal exception in your program. The message
string is taken from the original exception. The remote traceback string is
available on the PyroException
object in the _pyroTraceback
field.
FAQs
This library allows your Java program to interface very easily with the Python world. It uses the Pyro protocol to call methods on remote objects. (See https://pyro5.readthedocs.io/). Pyrolite only implements part of the client side Pyro library, hence its name 'lite'... So if you don't need Pyro's full feature set, Pyrolite may be a good choice to connect java or .NET and python. Version 5.0 changes: support Pyro5 wire protocol. Dropped support of Pyro4 (stick to version 4.xx for that).
We found that net.razorvine:pyrolite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.