Git Product home page Git Product logo

nanoblocks's People

Contributors

ipazc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nanoblocks's Issues

Account.__str__ throws pytz.exceptions.UnknownTimeZoneError: 'CEST'

Hello!
Many public nodes have the timezone set to "CEST", which is not a real timezone, which means that when parsing the account, this exception is thrown.

Code to reproduce

from nanoblocks.node import NanoNode
from nanoblocks.network import NanoNetwork

my_address = "nano_3x3r177uxmk33hi9wk186dmhhikicbs79h78g8bmci8ghqxc7bqbg6x6a1oa"
node = NanoNode("https://mynano.ninja/api/node", "wss://ws.mynano.ninja/")
network = NanoNetwork(node)
account = network.accounts[my_address]
print(account) # The print statement throws error

Stacktrace

Traceback (most recent call last):
  File "app.py", line 13, in <module>
    print(account)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nanoblocks/account/account.py", line 430, in __str__
    return f"{self.address} (\n\t" \
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/nanoblocks/account/account.py", line 388, in modified_date
    m_datetime = pd.to_datetime(
  File "pandas/_libs/tslibs/timestamps.pyx", line 1378, in pandas._libs.tslibs.timestamps.Timestamp.tz_convert
  File "pandas/_libs/tslibs/timestamps.pyx", line 1094, in pandas._libs.tslibs.timestamps.Timestamp.__new__
  File "pandas/_libs/tslibs/timezones.pyx", line 114, in pandas._libs.tslibs.timezones.maybe_get_tz
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pytz/__init__.py", line 188, in timezone
    raise UnknownTimeZoneError(zone)
pytz.exceptions.UnknownTimeZoneError: 'CEST'

Suggestion

CEST should be transformed to a real timezone, such as Europe/Paris, Europe/Berlin or Europe/Prague (or another one)
Or ignore timezone
Relevant: https://stackoverflow.com/questions/10913986/correctly-parse-date-string-with-timezone-information

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.