Skip to main content

Fetch SEC 10-K company facts dataframes

Project description

SEC Company Facts

A minimal Python library for fetching yearly 10-K company facts from data.sec.gov in dictionary or Pandas DataFrame format.

Only supports 10-K reports.

Example:

from sec_company_facts import CompanyFacts
from matplotlib.ticker import MaxNLocator
import matplotlib.pyplot as plt

company = CompanyFacts.from_ticker("AAPL")

df = company.get_yearly_dataframe(
    [
        "NetIncomeLoss",
        ["PaymentsOfDividendsCommonStock", "PaymentsOfDividends"],
        "PaymentsForRepurchaseOfCommonStock",
    ]
)

df["Net Income ($B)"] = df["NetIncomeLoss"] / 1_000_000_000
df["Dividends + Buybacks ($B)"] = (
    df["PaymentsOfDividendsCommonStock"] + df["PaymentsForRepurchaseOfCommonStock"]
) / 1_000_000_000

print(df)

plt.plot(df.index, df["Net Income ($B)"], marker="o", label="Net Income")
plt.plot(
    df.index, df["Dividends + Buybacks ($B)"], marker="o", label="Dividends + Buybacks"
)
ax = plt.gca()
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
plt.ylim(bottom=0)
plt.title("Dividends + buybacks, and income")
plt.xlabel("Fiscal Year")
plt.ylabel("$ billions")
plt.grid(True, alpha=0.7)
plt.legend()
plt.savefig("payout_ratio.svg")
plt.show()

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

sec_company_facts-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

sec_company_facts-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sec_company_facts-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for sec_company_facts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 768b8fda438731589b20d96af0c9aedc173ef27ad1e5ccd8267a17cc3e17c763
MD5 410b09e0cb82794416ae14b55e04e251
BLAKE2b-256 7186bec80a1bc4845e85e0354d1b8ef80addfe3a62901e9e83ae5de9326f237c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sec_company_facts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15c599d8b7c8e61ff84427c029d6e7a3e0ac8c3d20e16f32f938640b67c5e8c1
MD5 941fa13672e368a3ac7f99cbd6f11580
BLAKE2b-256 9e3f084a19edfe81f7fc0df73e854567b6ce40cdb8de2923551c7234e89e4ef3

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