User Guide
Introduction
Registered Investment Companies (RIC) except money market funds are required to publish their portfolio holdings as well as risk and stress tests with a NPORT-P filing. Until August 2024 these reports had to be made on a quarterly frequency with the filing of the report 30 days after the fiscal quarter-end and the publication 60 days later. Since then its frequency has been increased to monthly reports. The reports contain a limited set of static reference data as well as fair values for each instrument at the report date. Therefore, they can shed some light into the current pricing in certain illiquid markets. Also for any other data projects analyzing the movements in funds portfolios or the positioning of certain entities, the reports can be very valuable.
This package aims to build a simple connector to receive the data contained in these reports. While other packages focussing on SEC filings have a broader range of supported filings, they lack the required detail often required for the NPORT-P filings. In case you look for something with a more general support for SEC filings, the package edgartools is recommended. Some of the bone architecture with connecting to the SEC is also heavily inspired from that project.
Installing sec-nport
The package is distributed using the python packet manager PyPI. This enables the easy installation using pip:
Code examples
Setting your identity
In order to send requests to the SEC, it is required to set your identity with your email address. This is implemented by using the environment variable EDGAR_IDENTITY
. A simple code example for setting your identity looks like this:
Afterwards, you can use any functions without issues. All requests are automatically rate-limited to a maximum of 8 requests per second which is a little below the allowed 10 requests per second ensuring that you are not timed out. Please keep in mind that the rate-limit is not designed to be threadsafe. This is also not required since your script is almost surely faster than the rate-limit, thus giving you no advantage of using multi-threading.
Get a list of filings
Before being able to download all filings, you first need to get a list of the available reports. You are able to list reports for any type of form but currently this package supports only the download of NPORT-P filings. The support may be extended in the future for other forms like N-MFP which contains the portfolio holdings of money market funds.
In the variable filings, a pandas dataframe will be loaded with the columns form, company, cik, filing_date, accession_number and url.
Download a filing
To read the filing, there are different ways. The easiest would be to just use the downloaded dataframe of filings and iterate over the given list of URLs. You could also give the path to a local xml file containing the NPORT-P report.
The report variable is an instance of the NPORT class and contains three main parts. First, a Registrant instance with report.registrant
which gives you all general information about the filing company. Second, you find a Fund instance with report.fund
showing you all information given about the fund itself, e.g. risk and stress tests and amount of total assets. Last, there is a list of portfolio holdings given in report.securities
, containing all instruments held by the fund with all the given static reference data and price information. Since the price information is probably on of the most relevant parts for the majority of users of this library, there is an easy way to download it together with all identifiers of the security and some other relevant information like holding size and currency.