Skip to content

For downloading and accessing financial data from SEC's EDGAR

License

Notifications You must be signed in to change notification settings

Creditrek/edgar-fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edgar-fetch

For downloading and accessing financial data from SEC's EDGAR

To install dependencies in virtual environment with pip

Do the following at the root:

pip install -r requirements.txt

But before doing this, you might consider installing the whole package in the virtual environment, which would automatically install all required dependencies.

To install the package locally

Do the following after changing directory (cd) to the edgar-fetch root directory in the terminal:

pip install -e .

Goal

To fetch SEC filings, both latest and historical, for credit risk reseacrch of companies in emerging markets especially the small and medium-size enterprises (SMEs). It is expected the focus will be on the major risk ratios: i.e. the debt, solvency, and profitabilty metrics. Particular attention should be paid to new markets in the retail and commercial segments of the startup landscape. We will therefore give less attention to the banking segment.

Quickstart

To download the required SEC finanical statement data (via DERA) with a year since (e.g. 2015) and a year before (e.g., 2021, not inclusive), do the following on either a Jupyter notebook or ipython (or similar) terminal with Python version at least 3.8:

from edgar_fetch.downloader import Fetcher

fetcher = Fetcher("/Users/username/edgar-fetch/data/")  # This is the path to an existing data directory that comes with the installation. 
fetcher.get_all(2015, 2021, False)

fetcher.unzip_files()

The last step is to extract all the zip files into their respective folders. Note that these directories, if not present already, will be autogenerated.

To download EDGAR full-index financial data (e.g. 8-K) for a single firm (e.g. Apple with ticker "AAPL"), do the following instead:

from edgar_fetch.downloader import Fetcher
fetcher = Fetcher("/Users/username/edgar-fetch/data/")  # This is the path to an existing data directory that comes with the installation.
fetcher.get_company("8-K", "AAPL")