pandas-datareader icon indicating copy to clipboard operation
pandas-datareader copied to clipboard

TSP share fund history is not reachable

Open Cronospr opened this issue 3 years ago • 1 comments

There was a big change in the TSP website for tracking, accessing and contribute.

import pandas_datareader.tsp as tsp tspreader = tsp.TSPReader(start='2022-06-01', end='2022-06-02') tspreader.read() Traceback (most recent call last): File "", line 1, in ... pandas_datareader._utils.RemoteDataError: Unable to read URL: https://secure.tsp.gov/components/CORS/getSharePricesRaw.html?startdate=20220601&enddate=20220602&download=0&Lfunds=1&InvFunds=1

Cronospr avatar Jul 25 '22 17:07 Cronospr

I also found the same err. Looks their URL is changed. Test case failed.

From tests/test_tse.py TSPReader supposed to returns fund info. Are they the relocated data ?

https://www.tsp.gov/fund-performance/ https://www.tsp.gov/share-price-history/

$ pytest-3 pandas_datareader/tests/test_tsp.py >& test_tsp.log
$ tail test_tsp.log 
                raise SSLError(e, request=request)
    
>           raise ConnectionError(e, request=request)
E           requests.exceptions.ConnectionError: HTTPSConnectionPool(host='secure.tsp.gov', port=443): Max retries exceeded with url: /components/CORS/getSharePricesRaw.html?startdate=20151102&enddate=20151102&download=0&Lfunds=1&InvFunds=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fae333811c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

../../../.local/lib/python3.9/site-packages/requests/adapters.py:565: ConnectionError
=========================== short test summary info ============================
FAILED pandas_datareader/tests/test_tsp.py::TestTSPFunds::test_get_allfunds
FAILED pandas_datareader/tests/test_tsp.py::TestTSPFunds::test_get_one_fund
========================= 2 failed, 1 passed in 0.61s ==========================

my env

$ for i in `cut -f 1 -d '>' requirements.txt | xargs`; do python3 -m pip list | grep $i ; done
lxml                     4.6.3
pandas                   1.1.5
pandas-datareader        0.10.0.dev0+78.gab26ad2.dirty
requests                 2.28.1
requests-kerberos        0.12.0
requests-ntlm            1.1.0
requests-toolbelt        0.9.1
for i in `cut -f 1 -d '>' requirements-dev.txt | xargs`; do python3 -m pip list | grep $i ; done
flake8                   3.8.4
pytest                   6.0.2
wrapt                    1.12.1
$ python -V
Python 3.9.2

yosukesan avatar Jan 07 '23 16:01 yosukesan