6

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?

Ivo
  • 1,673
  • 3
  • 19
  • 28
  • 1
    Theoretically possible, but I've never heard of this being implemented, and it's unlikely to be worthwhile. –  Feb 24 '13 at 19:49
  • maybe something from this question will help? http://stackoverflow.com/questions/683462/best-way-to-integrate-python-and-javascript – fsw Feb 24 '13 at 20:12
  • I saw that, but this is a question if python modules can/should be ported to node.js rather than an actual problem that requires a JS <-> Python bridge. – Ivo Feb 24 '13 at 23:10

2 Answers2

3

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)

Community
  • 1
  • 1
3lRicko
  • 1,595
  • 1
  • 9
  • 4
2

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.

Ivo
  • 1,673
  • 3
  • 19
  • 28
  • 1
    Note on that - it uses IronPython, .NET's python implementation, and for Edge.js, the docs say (as of 2018-03-14) that this has only been tested on Windows. – jv-dev Mar 14 '18 at 18:10