alienbrett / PyAlly

Ally Invest API Module for Python3
https://alienbrett.github.io/PyAlly/
MIT License
57 stars 28 forks source link

Why do you have pyximport; pyximport.install()? #35

Closed cpollio83 closed 4 years ago

cpollio83 commented 4 years ago

I see you import these at the beginning of every file. I'm not quite sure what they are doing in your code and everything works fine for me after I removed them. I'm not a python expert so I would love to know and learn something here. I'm just paranoid about security when it comes to my finances.

eyesuk commented 4 years ago

Hello pollio We can go into a rabbit hole here about its purpose, but is much easier to point you to the cython documentation.

Cython uses a bunch of C libraries to increase performance among others things...

When in doubt stackoverflow out lol, here is a good thread

if you are really paranoid, you can monitor all http traffic in and out of your NIC and search the logs for weird sh*t.

Have a great day..

alienbrett commented 4 years ago

The reason to include pyximport was originally for speed- to minimize the latency between calling one of the PyAlly functions and and receiving a response from the Ally API servers. However, I've decided to pull those lines from the project and remove the Cython dependency. The reason being- if someone values speed, they can pull the code and cythonize it themselves. Other users might appreciate the fewer dependencies.

That said, if execution speed is important to you, look into Cython as @eyesuk posted- its great for speeding up native python.