Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case insensitive #188

Open
wannadrunk opened this issue Dec 29, 2022 · 1 comment
Open

case insensitive #188

wannadrunk opened this issue Dec 29, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@wannadrunk
Copy link

🚀 Feature Request

case insensitive in key name

🔈 Motivation

got the error when doing nav.get() with the lowercase of the fund name. Could we convert it to the required case? It will make library more robust.

>>> nav.get('scbnk225d')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxx/git/tmp/temp/venv-tmp/lib/python3.10/site-packages/pythainav/api.py", line 45, in get
    nav = _source.get(fund_name, date)
  File "/home/xxx/git/tmp/temp/venv-tmp/lib/python3.10/site-packages/pythainav/sources.py", line 56, in get
    url.args["fund"] = name2fund[fund]["id"]
KeyError: 'scbnk225d'

>>> nav.get('SCBNK225D')
Nav(value=13.1079, updated=datetime.datetime(2022, 12, 28, 0, 0), tags={'latest'}, fund='SCBNK225D')

@wannadrunk wannadrunk added the enhancement New feature or request label Dec 29, 2022
@wasdee
Copy link
Owner

wasdee commented Dec 30, 2022

thank you for your issue, the solution should be simple. but let me see if there is a name conflict

@wasdee wasdee self-assigned this Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants