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.

Installation:

pip install sec_company_facts

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("AAPL income and dividends + buybacks")
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.4.tar.gz (5.4 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.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sec_company_facts-0.1.4.tar.gz
  • Upload date:
  • Size: 5.4 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.4.tar.gz
Algorithm Hash digest
SHA256 513ba3546f5c4f9f574f17f94d38cc70b360300cb5320e08a831a2960575f0ff
MD5 aabb9f4c572aee77e4a4fd31674ce939
BLAKE2b-256 c34947f14b046c185f13fcc99a05651fb3ec425aaead8b732c80be4403d7db18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sec_company_facts-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a4d40fa0f01d008fd6be068eae7afd6b1bed0684d76ebf9e50f73eef8f348ef2
MD5 affc604411c17d5c53108fba710b9bef
BLAKE2b-256 e3b62bb0edf6810e26d787a932be267c0890f89121a3bdd7def22d518ac779e0

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