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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sec_company_facts-0.1.3.tar.gz.
File metadata
- Download URL: sec_company_facts-0.1.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
239ea7ed21f9d254d01896b08deec04705c93d90edc797990a41bbd46f64742a
|
|
| MD5 |
54298345f0966970b7a24ff7803f3941
|
|
| BLAKE2b-256 |
dd4e56bd914425dce8e12eee7209a7a3eae3954cb8ecf0db40f252f6b49b61f7
|
File details
Details for the file sec_company_facts-0.1.3-py3-none-any.whl.
File metadata
- Download URL: sec_company_facts-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911ded6d688a9f25484e0f179780eff9fff8a0160e0526b460bcf425c939844a
|
|
| MD5 |
d9808db42669ffa2bf35d5e5c0b5c9ec
|
|
| BLAKE2b-256 |
f4f42c0b11c83ef6c15e8e81cdbb3def9cd8d1ecc5de70326bdfaa1b38c77545
|