Fetching weekly economic indicators

Hide code cell content
import refinitiv.data as rd

rd.open_session()
/home/runner/.local/share/virtualenvs/refinitiv-data-python-cookbook-I-HIyNf4/lib/python3.10/site-packages/refinitiv/data/_access_layer/session.py:71:FutureWarning: 
You open a platform session using the default value of the signon_control parameter (signon_control=True).
In future library version v2.0, this default will be changed to False.
If you want to keep the same behavior as today, you will need to set the signon_control parameter to True either in the library configuration file
({'sessions':{'platform':{'your_session_name':{'signon_control':true}}}}) or in your code where you create the Platform Session.
These alternative options are already supported in the current version of the library.
<refinitiv.data.session.Definition object at 0x7f9cb49e0fd0 {name='rdp'}>

You can use the Refinitiv Data Library for Python to retrieve weekly economic indicators by passing the relevent Refinitiv Instrument Code to the get_history function with the interval parameter set to "weekly".

Here’s how to retrieve the number of new jobless claims in the US, a weekly indicator released by the US Department of Labor:

rd.get_history(
    "USJOB=ECI",
    interval="weekly",
)
USJOB=ECI VALUE
Date
2023-12-09 205000
2023-12-16 207000
2023-12-23 213000
2023-12-30 198000
2024-01-06 198000
2024-01-13 194000
2024-01-20 221000
2024-01-27 225000
2024-02-03 213000
2024-02-10 211000
2024-02-17 200000
2024-02-24 213000
2024-03-02 210000
2024-03-09 212000
2024-03-16 212000
2024-03-23 212000
2024-03-30 222000
2024-04-06 212000
2024-04-13 212000
2024-04-20 207000
Hide code cell content
rd.close_session()