0

I have been working Python pandas DF. I usually Load a csv files, but at the same time I have excel files too. I find out pandas is very slow reading Excel files. I have JavaScript code that will convert from excel to csv. I am looking to way calling this script to automating conversion to csv to speed the pipeline. Basically do conversion behind scene. What is the best way to do this? I can share JS code anytime.

mtkilic
  • 1,213
  • 1
  • 12
  • 28

2 Answers2

1

start node app from python script explains how to use python subprocess to run a node.js script.

node.js runs javascript code on a v8 (chrome) engine. It's is easy to install on both Linux and Windows. There's an active SO tag, https://stackoverflow.com/questions/tagged/node.js

I like coffeescript as a way of writing javascript code with a syntax that is much more like Python.

I've see Python web stack questions (e.g. django) that talk about running javascript, though that might be on the client side rather than the serve.

Community
  • 1
  • 1
hpaulj
  • 221,503
  • 14
  • 230
  • 353
0

I follow subprocess method and it worked perfectly for me. Here is what I added to my code, order to run javascript code from python.

Import subprocess
subprocess.check_call(["cscript", "yourjsfile.js"])
mtkilic
  • 1,213
  • 1
  • 12
  • 28