Category Archives: Python

Link New DealScan to Compustat

From the August 2021 update, DealScan revamped its database structure and revised its contents. IDs in the new LoanConnector Dealscan are not compatible with those in the Legacy Dealscan. As a result, the linking table provided by WRDS and Professor … Continue reading

Posted in Python | Leave a comment

My thoughts on Python for accounting research

There is a temptation for accounting PhD students to invest in learning Python. However, I would recommend that accounting PhD students focus more on SAS + Stata than on Python in their first year for a few practical and technical … Continue reading

Posted in Learning Resources, Python | Tagged , | 1 Comment

Lawsuit data from Stanford Law School’s Securities Class Action Clearinghouse

The Python script in the original post has been removed as its use violates the Terms of Service of the data provider. Stanford Law School’s Securities Class Action Clearinghouse is always happy to share the data (subject to a Non-Disclosure … Continue reading

Posted in Python | Tagged | 14 Comments

Use Python to extract URLs to HTML-format SEC filings on EDGAR

[Update on 2020-06-26] Eduardo has made a significant improvement to the code. Now you can specify a starting date and download the index file during the period from that starting date to the most recent date. I expect it to … Continue reading

Posted in Python | 48 Comments

Use Python to download data from the DTCC’s Swap Data Repository

I helped my friend to download data from the DTCC’s Swap Data Repository. I am not familiar with the data and just use this as a programming practice. This article gives an introduction to the origin of the data: http://www.dtcc.com/news/2013/january/03/swap-data-repository-real-time The … Continue reading

Posted in Data, Python | Leave a comment

Use Python to download TXT-format SEC filings on EDGAR (Part II)

[Update on 2019-07-31] This post, together with its sibling post “Part I“, has been my most-viewed post since I created this website. However, the landscape of 10-K/Q filings has changed dramatically over the past decade, and the text-format filings are … Continue reading

Posted in Data, Python | 59 Comments

Use Python to extract Intelligence Indexing fields in Factiva articles

First of all, I acknowledge that I benefit a lot from Neal Caren’s blog post Cleaning up LexisNexis Files. Thanks Neal. Factiva (as well as LexisNexis Academic) is a comprehensive repository of newspapers, magazines, and other news articles. I first … Continue reading

Posted in Python | 16 Comments

Use Python to calculate the tone of financial articles

[Update on 2019-03-01] I completely rewrite the Python program. The updates include: I include two domain-specific dictionaries: Loughran and McDonald’s and Henry’s dictionaries, and you can choose which dictionary to use. I add negation check as suggested by Loughran and … Continue reading

Posted in Python | 14 Comments

Use Python to download TXT-format SEC filings on EDGAR (Part I)

[Update on 2019-07-31] This post, together with its sibling post “Part II“, has been my most-viewed post since I created this website. However, the landscape of 10-K/Q filings has changed dramatically over the past decade, and the text-format filings are extremely … Continue reading

Posted in Data, Python | 67 Comments