You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and many others... (a global lint would be required)
Maybe we should add in utils a function to build url from a base URL (and endpoint) and a dictionary of parameters and encourage each data reader developer to use it.
Hello,
I noticed that each data reader have it's own way to build URL.
That's sometimes very ugly.
For example there is things like (
yahoo/components.py
)the use of
urlencode
should probably be preferedpylint
doesn't like inyahoo/actions.py
(tabulations)and many others... (a global lint would be required)
Maybe we should add in
utils
a function to build url from a base URL (and endpoint) and a dictionary of parameters and encourage each data reader developer to use it.Such a function could be
So in
google/daily.py
we could haveinstead of
(I think
'%b %d, ' '%Y'
is a typo it should be'%b %d, %Y'
)or in
yahoo/daily.py
instead ofwe could have
WorldBank API url create could also be improved:
in
_get_data
, instead of"http://api.worldbank.org" is often repeat
in such a url there is 3 parts:
base url: "http://api.worldbank.org"
endpoint: "/countries/US/indicators/NY.GNS.ICTR.GN.ZS" (for example)
parameters: date=2012:2015&per_page=25000&format=json
We shouldn't repeat ourself
https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
we could have
global
in
get_data
Maybe we might define how data reader "should" build URLs.
Kind regards
The text was updated successfully, but these errors were encountered: