Giter Club home page Giter Club logo

Comments (14)

alvarobartt avatar alvarobartt commented on May 27, 2024 1

Hi @InnovArul, sure you're right, I'll probably roll back investiny to use investpy format by default, which is dd/mm/yyyy 👍🏻

from investiny.

InnovArul avatar InnovArul commented on May 27, 2024 1

@alvarobartt thats awesome. thanks! :)

from investiny.

alvarobartt avatar alvarobartt commented on May 27, 2024 1

Right @GSLabIt, so the intervals are as it follows: 1, 5, 15, 30, 45, 60, 120, 240, 300, "D", "W", "M", find more details at https://alvarobartt.github.io/investiny

from investiny.

ramakrishnamekala129 avatar ramakrishnamekala129 commented on May 27, 2024

no but u can convert it by d.strftime('%m/%d/%Y') d for dateformat

from investiny.

GSLabIt avatar GSLabIt commented on May 27, 2024

no but u can convert it by d.strftime('%m/%d/%Y') d for dateformat

well ok ..but yyyy-mm-dd is widely used ..btw ..thx anyway

from investiny.

GSLabIt avatar GSLabIt commented on May 27, 2024

found an issue on same day data, try:

d = historical_data(6408, '09/01/2022', '09/01/2022', "1")

i get an error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "venv-3/lib/python3.8/site-packages/investiny/historical.py", line 48, in historical_data "date": [datetime.fromtimestamp(t).strftime(time_format) for t in data["t"]], # type: ignore KeyError: 't'

from investiny.

GSLabIt avatar GSLabIt commented on May 27, 2024

Could you at least change:

d['date] = [ '13:25 09/01/2022' .....] to [ '09/01/2022 13:25' .....]

from investiny.

InnovArul avatar InnovArul commented on May 27, 2024

I had a similar question regarding the date format.
In investpy library, the date format followed was %d/%m/%Y. In investiny library, the date format is changed to %m/%d/%Y.
Would it be possible to maintain consistency?
I think its ok to follow any of these formats. If possible, please maintain the same format in both libraries?

from investiny.

alvarobartt avatar alvarobartt commented on May 27, 2024

Hi @GSLabIt I'm still exploring how to add that functionality, but I'll probably add some environment variables or a configuration file to define all those things (like input formats, output formats, timezone, etc.) so that you set it up once and that's it 👍🏻

from investiny.

alvarobartt avatar alvarobartt commented on May 27, 2024

Indeed I don't know why I picked the %m/%d/%Y when it's probably the most confusing date format ever lol... Now this is a breaking change as some developers are already using investiny as a replacement for investpy, so let me figure out the best way to do it without breaking anything. Thanks! 🤗

from investiny.

GSLabIt avatar GSLabIt commented on May 27, 2024

found an issue on same day data, try:

d = historical_data(6408, '09/01/2022', '09/01/2022', "1")

i get an error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "venv-3/lib/python3.8/site-packages/investiny/historical.py", line 48, in historical_data "date": [datetime.fromtimestamp(t).strftime(time_format) for t in data["t"]], # type: ignore KeyError: 't'

I found the issue.. need to use int when interval is numeric a value.

from investiny.

GSLabIt avatar GSLabIt commented on May 27, 2024

Right @GSLabIt, so the intervals are as it follows: 1, 5, 15, 30, 45, 60, 120, 240, 300, "D", "W", "M", find more details at https://alvarobartt.github.io/investiny

Could you add a check for interval, kind of if interval = int(interval) if interval.isdigit() else interval. This will avoid issues 😅

from investiny.

alvarobartt avatar alvarobartt commented on May 27, 2024

@GSLabIt let me think about that! 👍🏻

from investiny.

alvarobartt avatar alvarobartt commented on May 27, 2024

Hi again @GSLabIt I've decided to use environment variables at the end, I still need to add the documentation page of this newly included feature, but in the meantime you can set the environment values of INVESTINY_DATE_FORMAT and INVESTINY_TIME_FORMAT to use your preferred format for both the date and the date plus the time, default values are %m/%d/%Y and %m/%d/%y %H/%M, respectively.

To install the current unreleased version please run pip install git+https://github.com/alvarobartt/investiny.git

from investiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.