Giter Site home page Giter Site logo

parse_13f's Introduction

parse_13F

Some tools for parsing Form 13F filings with the SEC

R code

Thus far, this is just a small R module that I wrote to parse 13F filings. These are available as XML files from EDGAR. For instance, if you want to ride Seth Klarmann's coattails, those from Baupost (CIK 0001061768) can be found here, with the latest form13fInfoTable.xml.

The R script parse_13f.R handles XML tables like the above.

example.R uses it to parse Baupost's 2017 Q1 filings (also here), dump the raw data to a CSV (see here), perform some conversions with dplyr, order by percentage relative to the whole portfolio, and then output a CSV file containing this new dataframe (see here).

example2.R parses adjacent quarterly filings and determines the likely portfolio changes between those two quarters.

example3.R is basically a copy of example.R which parses a CSV exported from Fidelity (not included), and compares this portfolio to the 13F's contents (and determines the changes made to match the same ratios).

Python code

The Python code is just a single source file at the moment, and mostly scratch work. It depends on Pandas, and uses this and some built-in libraries to parse the XML and turn it to Pandas tables.

To-do items

  • It might be nice to turn the CUSIP into a ticker symbol in order to link the tables against other data sources - for instance, the present price. The FinancialInstrument library looks like it at least knows how to query online APIs for related information, but I wasn't able to get anywhere.
  • I'd like to use the proper namespaces when finding nodes in the XML with XPath rather than just telling it to ignore them, but I have no idea what the namespaces are.

Disclaimer

I'm not affiliated with Baupost, nor with any other party mentioned here, nor should anything I wrote above be taken as investment or financial advice, nor do I warrant that the code does anything it claims to. I am not your lawyer. I am not your financial advisor. I am not responsible for what you do with money.

parse_13f's People

Contributors

hodapp87 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.