Automate 8 digit CUSIP to pull Scope 1 and 2 emissions

portfolio_holdings CUSIP.pdf Attached are the portfolio holdings I have retrieved from the 13F holdings from Refinitiv. The column name "CUSIP" provides the company 8-digit CUSIP. My next step is to obtain the Scope 1 and Scope 2 emissions from each company listed here. This is only a small part of my dataset; therefore, I wish to automate this to ensure efficiency through a Python environment.
Created below on CODEBK
import refinitiv.data as rd
rd.open_session()
df = rd.get_data(
universe = [
'594918104','02079K305','037833100'
],
fields = [
'TR.RIC',
'TR.CO2DirectScope1',
'TR.CO2IndirectScope2'
]
)
display(df)
But client requests to automate this on Python environment using the attached CUSIP.
Best Answer
-
I can see you have the general approach to retrieve the emissions data. You'll just need to figure out how to programmatically retrieve the holdings data. I have no idea where this data is coming from and whether the is an API to retrieve it. Might be helpful if you provide some context of the source of data and which service is providing it and whether an API exists.
Assuming an API exists, hopefully the service does provide the ability to capture the list of CUSIPs within a text file or JSON collection to be processed. From there, it's a matter of processing the collection and submitting the request.
0
Answers
-
Hi team
I have extracted the data from Thomson Reuters Institutional (13f) Holdings - s34 Master File from Wharton Database API. Here is my query to extract Wharton data from python environment:
query = """SELECT *
FROM tfn.s34
WHERE fdate >= '2008-01-01'
AND fdate <= '2022-12-31'
"""
inst_hold = conn.raw_sql(query)
I have only the possibility to get 8-digit CUSIP from the holdings. Now I want scope 1 and scope 2 of each of the companies each year based on their 8-digit CUSIP from DataStream.
0 -
Hi team,
I have extracted the data from Thomson Reuters Institutional (13f) Holdings - s34 Master File from Wharton Database API. Here is my query to extract Wharton data from python environment:
query = """SELECT *
FROM tfn.s34
WHERE fdate >= '2008-01-01'
AND fdate <= '2022-12-31'
"""
inst_hold = conn.raw_sql(query)
I have only the possibility to get 8-digit CUSIP from the holdings. Now I want scope 1 and scope 2 of each of the companies each year based on their 8-digit CUSIP from DataStream.
0 -
The above code provided by @MarkJoseph.Canada, will give you the Scope 1 and Scope 2 of each company. You provided an SQL query but the above you provided is not Python code. We can only provide guidance and examples in this forum for users to use within their own application workflows - we don't create full solutions when we don't have access to your workflows and data environments nor your permissions.
It's unclear what you need. If you are looking how to programmatically execute SQL from Python and process the results to pull out the CUSIP values from the results, I would suggest using ChatGPT or CoPilot as they can provide some great examples for you to use.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 251 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 650 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛