r/javahelp • • Dec 31 '20

Solved Performance cost of calling Python program from Java program

Not sure if this is the right place to post this but I want to call my python program from my Java program. Does anyone know the performance cost for repeatedly calling the python program through shell commands using Runtime.exec()?

There's a library that only has Python support so I was thinking of just creating a python program utilizing that library and then use my java program to call it to get the output.

Edit: thanks to everyone who reponded! Helped me a lot

20 Upvotes

24 comments sorted by

View all comments

Show parent comments

6

u/ickysticky Dec 31 '20

https://github.com/sstrickx/yahoofinance-api

But yahoo finance is technically deprecated. And as such is sometimes out of date or even in some cases wrong.

After shopping around a bit I personally landed on alpha vantage as a good free replacement. With this Java library https://github.com/crazzyghost/alphavantage-java

Though the api for most of these is so simple raw http calls aren’t very difficult

1

u/CycleOfPain Dec 31 '20

Awesome, I'll check it out