I'm using the lseg-data Python package (v2.1.1) to retrieve corporate bond data.
What works:
ld.discovery.search(view=GOV_CORP_INSTRUMENTS, filter="IssuerName eq 'Apple'") returns active bonds (AssetState=AC)ld.get_data(universe=['US03785EPC20'], fields=['TR.FiOriginalYieldMaturity'], parameters={'CH': 'Fd', 'RH': 'IN'}) successfully returns data for a known matured bond ISIN
What I need:I need to search for bonds that have already matured or been decommissioned (AssetState=DC or inactive), not just retrieve data for known ISINs. In the Workspace terminal, the GOVSRCH app supports "Status → Include: Inactive (only)".
Question:What is the equivalent API approach? Specifically:
- Can
ld.discovery.search() return inactive bonds with a different view or filter (e.g., AssetState eq 'DC')? - Is there a screener formula for
ld.get_data() that includes inactive fixed-income instruments? - Alternatively, can a GOVSRCH search result saved as a Workspace Saved List be referenced as a universe in the Python API?
Any working code example would be greatly appreciated. Thank you!