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

added tiingo csv response serialisation options #822

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tch
Copy link

@tch tch commented Aug 31, 2020

  • [y] closes Support CSV response format in Tiingo API #821
  • [y] tests added / passed *
  • [y] passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • [y] passes black --check pandas_datareader
  • [y] added entry to docs/source/whatsnew/v.0.9.1.txt
  • Tests added as 'formats' fixture parametrisations ('json', 'csv') in test_tiingo.py

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2020

Codecov Report

Merging #822 into master will decrease coverage by 1.39%.
The diff coverage is 19.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #822      +/-   ##
==========================================
- Coverage   64.67%   63.27%   -1.40%     
==========================================
  Files          62       62              
  Lines        2848     2775      -73     
  Branches      305      306       +1     
==========================================
- Hits         1842     1756      -86     
- Misses        932      945      +13     
  Partials       74       74              
Impacted Files Coverage Δ
pandas_datareader/tiingo.py 25.66% <7.40%> (-8.00%) ⬇️
pandas_datareader/tests/test_tiingo.py 38.00% <42.85%> (-4.31%) ⬇️
pandas_datareader/base.py 84.09% <100.00%> (-0.47%) ⬇️
pandas_datareader/av/time_series.py 30.23% <0.00%> (-9.77%) ⬇️
pandas_datareader/tests/av/test_av_forex.py 50.00% <0.00%> (-8.07%) ⬇️
pandas_datareader/av/quotes.py 28.57% <0.00%> (-5.64%) ⬇️
pandas_datareader/av/forex.py 22.72% <0.00%> (-4.94%) ⬇️
pandas_datareader/tests/test_moex.py 73.91% <0.00%> (-4.35%) ⬇️
pandas_datareader/tests/av/test_av_quotes.py 50.00% <0.00%> (-4.17%) ⬇️
pandas_datareader/tests/av/test_av_sector.py 62.50% <0.00%> (-4.17%) ⬇️
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2ef4e6...1ffeeb1. Read the comment docs.

Copy link
Contributor

@bashtage bashtage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good. Hard par tis testing it given the API key.

If no value is provided, defaults to 5min. The minimum value is "1min".
Units in minutes (min) and hours (hour) are accepted.
Re-sample frequency. Format is #min/hour; e.g. "15min" or "4hour".
If no value is provided, defaults to 5min. The minimum value is\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove to \ and fix spacing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"1min".
Units in minutes (min) and hours (hour) are accepted.
response_format : str, default 'json'
Format of response data returned by the underlying Tiingo REST API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this accurate? Perhaps something like: "The format to use in the request tot he TIINGO API. "csv" results in smaller payload, less bandwidth, and may result in smaller charges for accessing the TIINGO API"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - added wording along those lines. This would affect bandwidth limits and implicitly charges.

@@ -83,12 +90,15 @@ def __init__(
"environmental variable TIINGO_API_KEY."
)
self.api_key = api_key
self.response_format = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should raise ValueError if not one of the expected values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - done!

@tch
Copy link
Author

tch commented Sep 1, 2020

Regarding testing. The API has free plan - it would be possible to setup dedicated key for automated tests ( https://api.tiingo.com/about/pricing )

@tch tch requested a review from bashtage September 1, 2020 12:15
@tch
Copy link
Author

tch commented Sep 10, 2020

Hi, Just a quick ping to check whether I am missing anything for this PR to get it merged for a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CSV response format in Tiingo API
3 participants