A client library for collecting and scraping SEC filings.
Project description
Python SEC
Table of Contents
Overview
Current Version: 0.1.6
The Securities & Exchange Commission (SEC) has a treasure trove of business data available to indviduals for free. However, the biggest obstacle to getting this free data boils down to two challenges:
- Figuring out where it is
- Figuring out how to extract it
The Python SEC library (edgar
) is designed to make the collection and the extraction of SEC data quick
and effortless. The library was designed around some of the following goals:
- Making the usage of the EDGAR search system, in a prgorammatic fashion, more intuitive.
- Making the definition of queries more customizeable while still maintaining the overall clearity of the library.
- Standardize the returning content so that content is organized consistently and ensuring gaps in data are filled in or extended that way navigating to other directories or files can be done dynamically.
- Simplify the parsing of XBRL files so that data can be more easily manipulated.
Setup
Setup - PyPi Install:
To install the library, run the following command from the terminal.
pip install python-sec
Setup - PyPi Upgrade:
To upgrade the library, run the following command from the terminal.
pip install --upgrade python-sec
Setup - Local Install:
If you are planning to make modifications to this project or you would like to access it
before it has been indexed on PyPi
. I would recommend you either install this project
in editable
mode or do a local install
. For those of you, who want to make modifications
to this project. I would recommend you install the library in editable
mode.
If you want to install the library in editable
mode, make sure to run the setup.py
file, so you can install any dependencies you may need. To run the setup.py
file,
run the following command in your terminal.
pip install -e .
If you don't plan to make any modifications to the project but still want to use it across your different projects, then do a local install.
pip install .
This will install all the dependencies listed in the setup.py
file. Once done
you can use the library wherever you want.
Setup - PyPi Install:
To install the library, run the following command from the terminal.
pip install python-sec
Setup - PyPi Upgrade:
To upgrade the library, run the following command from the terminal.
pip install --upgrade python-sec
Usage
Here is a simple example of using the edgar
library to grab different groups of filings.
from pprint import pprint
from edgar.client import EdgarClient
from edgar.enums import StateCodes
from edgar.enums import CountryCodes
from edgar.enums import StandardIndustrialClassificationCodes
# Initialize the Edgar Client
edgar_client = EdgarClient()
# Initialize the Company Services.
company_services = edgar_client.companies()
# Grab all the companies that are based in Texas.
pprint(company_services.get_companies_by_state(state_code='TX'))
# Alternatively, if you didn't know the 2 letter code you could pass through an Enum.
pprint(
company_services.get_companies_by_state(
state_code=StateCodes.West_Virginia
)
)
# Grab all the companies that are based in Australia, same logic here with the Enums.
pprint(
company_services.get_companies_by_country(
country_code=CountryCodes.AUSTRALIA
)
)
Support These Projects
Patreon: Help support this project and future projects by donating to my Patreon Page. I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.
YouTube: If you'd like to watch more of my content, feel free to visit my YouTube channel Sigma Coding.
Questions: If you have questions please feel free to reach out to me at coding.sigma@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-sec-0.1.6.tar.gz
.
File metadata
- Download URL: python-sec-0.1.6.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54afc16c5d1cee21fdd48176f8b9ccf2cd7ed0e3faafd61855c95829a8565815 |
|
MD5 | 6cd0bc930439d958469927b9e5c03903 |
|
BLAKE2b-256 | 9f1b6a0b335a0e3be094fd39ce62d4062a21daf600f9dd2668b0520288334a61 |
File details
Details for the file python_sec-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: python_sec-0.1.6-py3-none-any.whl
- Upload date:
- Size: 61.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a5116298cb7dfd33bb4c1a41523c846371b6c010701445e5c6131e8902198a6 |
|
MD5 | c30dca970ae424c00e8437d2768f02d4 |
|
BLAKE2b-256 | dec939d1b0c8ebc5674d7fd0c1abfb616065c60cf9ee00a894e2c583eb875f0a |