I am a traditional SAS programmer, and only recently started to develop these python codes in an effort to branch into this new popular programming language. These programs target some of the most fundamental topics in empirical asset pricing, and should serve as a stepping stone for those who are relatively new to the programming world of empirical finance. Of course, these python code probably could use some improvement in coding efficiency, and I welcome any suggestions on that front.
If your institution is already a WRDS subscriber, you can find most of the codes below under the "Research Application" section of WRDS.
Data and Platform Setup
These codes are written under the WRDS data platform, where relevant empirical data (pricing, fundamental, estimates, etc) are called upon directly through the WRDS API. If your institution has proper WRDS data subscription, you can run the code directly under your Python environment.
Setting Up Sand Box
Connecting to WRDS
With the WRDS API, it is very straightforward to connect to WRDS and extract data through Python.
Market Anomalies and Risk Factors
Linking IBES and CRSP
Thomson Reuter's IBES database contains earnings and analyst forecasts related data, and researchers tend to link it with CRSP database for pricing related data to gauge market reaction to earnings related news. As these two databases do not have common native identifiers, this code aims to build a linkage between these two.