Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using python modules in node.js

Is it possible to create a glue that makes it possible for python modules (more specifically, library bindings) to be used in node.js? Some of the data structures can be directly mapped to V8 objects - e.g. array, dict.

More importantly - would that be a more elegant way to create bindings than manually or through FFI. In short, would it be worth it?

like image 915
Ivo Avatar asked Feb 24 '13 19:02

Ivo


2 Answers

Try this node.js module, that is a bridge: Node-Python,

NOTE: The Project is 7 years old and still stuck at v0.4. A lot of functionality like converting between Python and Node arrays is still missing. It may be safe to assume that it's no longer supported by its original author(s)

like image 180
3lRicko Avatar answered Sep 20 '22 13:09

3lRicko


Edge.js does a fine job at this. It allows you to write a Python script and then call the routines from Node.js, which can be used to easily create bindings with python modules.

like image 41
Ivo Avatar answered Sep 18 '22 13:09

Ivo