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.2.tar.gz (4.7 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.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sec_company_facts-0.1.2.tar.gz
  • Upload date:
  • Size: 4.7 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.2.tar.gz
Algorithm Hash digest
SHA256 684fb44ddb4ed9bc2443c35e9f626761484811cac73b34259f23d6e3f7aee8ff
MD5 1a2b51def5f75e959371eea061196a72
BLAKE2b-256 58cbba777892d9d06f1171fe2e37eb542b38ab64015903286224f4099bfe5538

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sec_company_facts-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 15bd9f9206c05b5576b45eddaa670e7b11dfc80734cafe19222a7c1b5ef943a1
MD5 966348debb9c80ae1ee8db48f27cea6f
BLAKE2b-256 267b8e2f407afdb4c605ebebc3755c60245ff91a1eb766776ccd3c6092218ecd

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