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.0.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.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sec_company_facts-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 3cc99d005c744074e90b95f93edea5d4c9940a5603e357f4f081d40146a5c9de
MD5 529edb88f45284c63d64e99dd96cbf0f
BLAKE2b-256 d2df6f65cc4a11ab804f83f16d6837b1311000dccee54e03b1624b8a2786c01c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sec_company_facts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b9193a43ccc53a2a8060726903d09c8364455d2c623286ad63f9c193a809e4b
MD5 0e641b27c1f693867a94cd5818533a6c
BLAKE2b-256 b4ebc4769612032b12216ea3def2ca11d5d8cb72b8e8d803958e11b452288a69

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