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 Python script will:

  1. download the daily Credit zip files; and
  2. extract CSV from individual zip files and combine the content into a single huge CSV (size 220MB), which then can be imported into Stata or other statistical package.

As of April 22, 2016, there were around one million historical records. The data seems available from April 6, 2013 and missing sporadically from then on. The Python script will print the bad dates where the daily data is not available.

 

This entry was posted in Data, Python. Bookmark the permalink.

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

  1. Rehypothecator says:

    Thank you for posting this. I’m currently struggling through downloading daily CSV files and the size of some of them is very cumbersome to the task of actually being able to sift through the data. I’m hopeful this, and some of your other posts, may help lead to the solution on my end. Appreciate it.

Leave a Reply

Your email address will not be published. Required fields are marked *