Skip to content

DownloadingData

Dwight Gunning edited this page Aug 18, 2024 · 1 revision

Downloading Data

Edgartools has been designed to work with real-time data from the SEC Edgar database. However, it is also possible to download bulk data from the SEC website and use Edgartools to work with the data.

Bulk data downloads

While edgartools is designed to access data on SEC Edgar in real-time, it is also possible to download bulk data from the SEC website and use edgartools to work with the data.

The bulk data takes up around 2.6GB of disk space.

The following datasets are currently included in the bulk data download:

  1. Company Filings - Filings for all companies
  2. Company Facts - Facts about a company

Downloading the data

To download the data, use the download function in the edgartools module.

from edgar import *
download_edgar_data()

Setting edgartools to use the local data

To use the local data, set the EDGAR_USE_LOCAL_DATA environment variable to the path where the data is stored. Alternatively, you can use the use_local_storage function in the edgartools module.

from edgar import *
use_local_storage()

Local data directory

By default the bulk data is downloaded to your user directory in a folder called edgar.

Windows

The default data directory is C:\Users\username\.edgar

Linux/Mac

The default data directory is /home/username/.edgar

Changing the data directory

You can change this by setting the EDGARTOOLS_DATA_DIR environment variable.

export EDGARTOOLS_DATA_DIR=/path/to/data

Notes about the data

  • The local data about company filings is limited to 1000 filings per company. If you need more data, then you have to use edgartools without the local data option.
  • Using local data means that to get the latest data you need to run download_edgar_data() again to get the latest data.
  • Using local data makes accessing the company significantly faster than without. So use it if you are iterating through a lot of companies.