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 0x7f5f1cd097e0 {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
2024-03-16 212000
2024-03-23 212000
2024-03-30 222000
2024-04-06 212000
2024-04-13 212000
2024-04-20 208000
2024-04-27 209000
2024-05-04 232000
2024-05-11 223000
2024-05-18 216000
2024-05-25 221000
2024-06-01 229000
2024-06-08 243000
2024-06-15 239000
2024-06-22 234000
2024-06-29 239000
2024-07-06 223000
2024-07-13 245000
2024-07-20 235000
2024-07-27 249000
Hide code cell content
rd.close_session()