Skip to main content

A Python package for SEC Edgar data

Project description

SECEdgar-Python

A simple library to interact with and retrieve information from the SEC Edgar Data.

Dependencies:

  • OS
  • pandas
  • requests
  • bs4

Installation

To install the required dependencies, run:

pip install -r requirements.txt

Functions

CIKExtractor() -> list

Extracts the CIK for S&P 500 companies from Wikipedia.

Usage:

from SECedgarpyExtractor import CIKExtractor
cik_list = CIKExtractor()
print(cik_list)

Concepts Used:

  • Web scraping using requests and BeautifulSoup
  • Error handling for HTTP requests

GetAllSP500CSV()

Gets all the S&P 500 info in the form of a CSV.

Usage:

from SECedgarpyExtractor import GetAllSP500CSV
GetAllSP500CSV()

Concepts Used:

  • Web scraping using pandas
  • Saving data to CSV

getCSVfile(URLlist: list[str], nameOfFile: str) -> None

Downloads the XLSX file from the list of URLs and converts them to CSV.

Usage:

from SECedgarpyDownloading import getCSVfile
getCSVfile(["url1", "url2"], "output_file")

Concepts Used:

  • HTTP requests
  • File handling
  • Data conversion using pandas

getXLSXfile(URLlist: list[str], nameOfFile: str) -> None

Downloads the XLSX file from the list of URLs.

Usage:

from SECedgarpyDownloading import getXLSXfile
getXLSXfile(["url1", "url2"], "output_file")

Concepts Used:

  • HTTP requests
  • File handling

GenerateCSVreport(nameOfFile)

Generates a CSV report by filtering and keeping the necessary sheets only.

Usage:

from SECedgarpyDownloading import GenerateCSVreport
GenerateCSVreport("input_file")

Concepts Used:

  • Data filtering
  • Data merging using pandas

download_and_convert_filtered_xlsx(URLlist: list[str], nameOfFile: str, target_sheets: list[str]) -> None

Downloads and converts filtered XLSX files to CSV.

Usage:

from SECedgarpyDownloading import download_and_convert_filtered_xlsx
download_and_convert_filtered_xlsx(["url1", "url2"], "output_file", ["sheet1", "sheet2"])

Concepts Used:

  • HTTP requests
  • Data filtering
  • Data conversion using pandas

filter_and_convert_to_csv(xlsx_file_path: str, csv_file_path: str, target_sheets: list[str]) -> None

Filters relevant sheets and converts them to CSV.

Usage:

from SECedgarpyDownloading import filter_and_convert_to_csv
filter_and_convert_to_csv("input.xlsx", "output.csv", ["sheet1", "sheet2"])

Concepts Used:

  • Data filtering
  • Data conversion using pandas

filterfunc(a: list) -> bool

Filters out and gets only the 10-K reports.

Usage:

from SECedgarpyProcessing import filterfunc
filtered_list = filter(filterfunc, data_list)

Concepts Used:

  • Data filtering using custom functions

extract10Kurl(cikval: str) -> list

Extracts the URL using the CIK which is passed into the function.

Usage:

from SECedgarpyProcessing import extract10Kurl
urls = extract10Kurl("0000320193")
print(urls)

Concepts Used:

  • API requests
  • Data extraction and transformation

URLtoXLSX(URLlist: list[str]) -> list

Converts the URL to direct XLSX files.

Usage:

from SECedgarpyProcessing import URLtoXLSX
xlsx_urls = URLtoXLSX(["url1", "url2"])
print(xlsx_urls)

Concepts Used:

  • URL manipulation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secedgar_python-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SECEdgar_Python-0.1.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file secedgar_python-0.1.1.tar.gz.

File metadata

  • Download URL: secedgar_python-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for secedgar_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7fc778c8865ea4f42370566213e53f3cb7ccb2fb5b44d3fa98eb9531dfbc046f
MD5 666afe81d92941ca9ebf430fe89ca2a4
BLAKE2b-256 e52b73b61a420e0f9310b4ce0d3aebfcba10e142e06a8895b7eb2ff2ae41c9f1

See more details on using hashes here.

File details

Details for the file SECEdgar_Python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for SECEdgar_Python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5866b18946d51773738e5387ae427e2732f32703bb71dad79cb72ef645fb5473
MD5 078bad3c938a8d61b038912f2970ad84
BLAKE2b-256 1e6c483c5d9a60d582b04347b1b56c1c5e5933bbc9c6b07d0d60a1d75231d992

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page