alvarobartt / investiny

🤏🏻 `investpy` but made tiny
https://alvarobartt.github.io/investiny
MIT License
316 stars 36 forks source link

make compatible with python 3.8 and some improvements #18

Closed GSLabIt closed 2 years ago

GSLabIt commented 2 years ago
df = pd.DataFrame.from_dict(data, orient ='columns')
df = df.set_index('date')

                  open        high         low       close
date
09/01/2022  147.490005  147.830002  146.779999  147.389999
09/02/2022  147.770004  149.100006  147.139999  148.330002
09/05/2022  149.070007  149.250000  147.369995  147.729996
09/06/2022  147.770004  149.020004  146.679993  147.270004
09/07/2022  147.020004  147.880005  146.740005  147.529999
09/08/2022  145.330002  145.809998  143.059998  143.160004
09/09/2022  143.139999  144.479996  142.460007  143.570007
09/12/2022  143.520004  144.559998  142.910004  144.500000
09/13/2022  144.169998  144.470001  143.000000  143.389999
09/14/2022  143.259995  143.869995  142.649994  143.630005
09/15/2022  143.580002  143.630005  142.740005  143.220001
09/16/2022  142.979996  143.240005  142.149994  142.729996
09/19/2022  143.190002  143.259995  142.179993  142.619995
09/20/2022  142.399994  142.580002  140.529999  140.699997
09/21/2022  140.860001  141.979996  140.729996  141.199997
09/22/2022  141.160004  142.020004  139.899994  140.020004
09/23/2022  140.139999  140.990005  138.449997  139.479996
09/26/2022  139.199997  139.220001  137.410004  138.869995
09/27/2022  137.699997  139.289993  136.619995  137.139999
09/28/2022  137.000000  138.740005  135.520004  137.910004
09/29/2022  138.330002  138.490005  136.220001  137.500000
alvarobartt commented 2 years ago

Thanks for your proposals @GSLabIt, I agree with making it compatible with Python 3.8 but regarding the addition of the pandas dependency I'm not sure, as I want to keep investiny tiny as its name says, so I don't think that using pandas makes sense here, but I'll add an entry in the documentation for integrations and there include the explanation on how to transform the output into a pandas.DataFrame, would that be ok?

Thank you again!

GSLabIt commented 2 years ago

Thanks for your proposals @GSLabIt, I agree with making it compatible with Python 3.8 but regarding the addition of the pandas dependency I'm not sure, as I want to keep investiny tiny as its name says, so I don't think that using pandas makes sense here, but I'll add an entry in the documentation for integrations and there include the explanation on how to transform the output into a pandas.DataFrame, would that be ok?

Thank you again!

it is ok.. I'll add my code

maread99 commented 2 years ago

Seems appropriate to mention here that I'm intending to add investiny as a data source for market_prices, hopefully next month. The interface should be exactly the same as with the existing PricesYahoo class, so...

@alvarobartt, given your plan to keep investiny tiny, I think market_prices could prove to be a nice extension to handle post-processing of prices (and indeed evaluation of the period to query). Let me know what you think if you get a chance to have a look at it. Currently its minimum supported python version is 3.8. I wasn't intending to move to 3.9 quite yet. If it makes little difference to you, I'd certainly appreciate it if you could drop the minimum requirement here to 3.8!

(Great work on introducing intraday price data! 🎉)

alvarobartt commented 2 years ago

Thanks for understading, @GSLabIt! And, @maread99 I don't have much free time but I'll try to check it at some point, in the meantime I can tell you that I'll make investiny support Python 3.8+ instead of Python 3.9+ in the next release (v0.5.0 if I'm not mistaken) coming later this weekend 👍🏻

GSLabIt commented 2 years ago

Thanks for understading, @GSLabIt! And, @maread99 I don't have much free time but I'll try to check it at some point, in the meantime I can tell you that I'll make investiny support Python 3.8+ instead of Python 3.9+ in the next release (v0.5.0 if I'm not mistaken) coming later this weekend 👍🏻

Could you add info on where to find investing_id?

alvarobartt commented 2 years ago

Hi @GSLabIt, sure I'll add a documentation entry on how to retrieve the Investing.com IDs (investing_id param), but you can find details on how to actually retrieve it by chaining the functions search_assets and historical_data at https://alvarobartt.github.io/investiny/usage/