|
187 | 187 | "cell_type": "markdown", |
188 | 188 | "id": "cell-quarterly-md", |
189 | 189 | "metadata": {}, |
190 | | - "source": [ |
191 | | - "## Quarterly Financial Statements from 10-Q\n", |
192 | | - "\n", |
193 | | - "`get_financials()` returns the latest annual (10-K) filing. To get quarterly data, parse a 10-Q filing directly:" |
194 | | - ] |
| 190 | + "source": "## Quarterly Financial Statements from 10-Q\n\nUse `get_quarterly_financials()` to get the latest quarterly data in one line:" |
195 | 191 | }, |
196 | 192 | { |
197 | 193 | "cell_type": "code", |
198 | 194 | "execution_count": null, |
199 | 195 | "id": "cell-quarterly", |
200 | 196 | "metadata": {}, |
201 | 197 | "outputs": [], |
202 | | - "source": [ |
203 | | - "from edgar.financials import Financials\n", |
204 | | - "\n", |
205 | | - "# Get the latest 10-Q filing\n", |
206 | | - "tenq = Company(\"AAPL\").get_filings(form=\"10-Q\")[0]\n", |
207 | | - "print(f\"Filing: {tenq.form} filed {tenq.filing_date}\\n\")\n", |
208 | | - "\n", |
209 | | - "# Parse quarterly financials\n", |
210 | | - "q_financials = Financials(tenq.xbrl())\n", |
211 | | - "q_financials.income_statement()" |
212 | | - ] |
| 198 | + "source": "q_financials = Company(\"AAPL\").get_quarterly_financials()\n\nq_financials.income_statement()" |
213 | 199 | }, |
214 | 200 | { |
215 | 201 | "cell_type": "markdown", |
|
276 | 262 | "cell_type": "markdown", |
277 | 263 | "id": "cell-reference", |
278 | 264 | "metadata": {}, |
279 | | - "source": [ |
280 | | - "## Quick Reference\n", |
281 | | - "\n", |
282 | | - "```python\n", |
283 | | - "from edgar import *\n", |
284 | | - "set_identity(\"your.name@example.com\")\n", |
285 | | - "\n", |
286 | | - "# ── Get financial statements (annual) ──\n", |
287 | | - "financials = Company(\"AAPL\").get_financials()\n", |
288 | | - "financials.income_statement() # Income statement\n", |
289 | | - "financials.balance_sheet() # Balance sheet\n", |
290 | | - "financials.cashflow_statement() # Cash flow statement\n", |
291 | | - "\n", |
292 | | - "# ── Key metrics ──\n", |
293 | | - "financials.get_revenue() # Revenue\n", |
294 | | - "financials.get_net_income() # Net income\n", |
295 | | - "financials.get_total_assets() # Total assets\n", |
296 | | - "financials.get_total_liabilities() # Total liabilities\n", |
297 | | - "financials.get_stockholders_equity() # Shareholders' equity\n", |
298 | | - "financials.get_financial_metrics() # Dict with ratios\n", |
299 | | - "\n", |
300 | | - "# ── Convert to DataFrame ──\n", |
301 | | - "statement = financials.income_statement()\n", |
302 | | - "df = statement.to_dataframe() # Full pandas DataFrame\n", |
303 | | - "\n", |
304 | | - "# ── Quarterly financials (from 10-Q) ──\n", |
305 | | - "from edgar.financials import Financials\n", |
306 | | - "tenq = Company(\"AAPL\").get_filings(form=\"10-Q\")[0]\n", |
307 | | - "q_fin = Financials(tenq.xbrl())\n", |
308 | | - "q_fin.income_statement() # Quarterly income statement\n", |
309 | | - "```" |
310 | | - ] |
| 265 | + "source": "## Quick Reference\n\n```python\nfrom edgar import *\nset_identity(\"your.name@example.com\")\n\n# ── Get financial statements (annual) ──\nfinancials = Company(\"AAPL\").get_financials()\nfinancials.income_statement() # Income statement\nfinancials.balance_sheet() # Balance sheet\nfinancials.cashflow_statement() # Cash flow statement\n\n# ── Key metrics ──\nfinancials.get_revenue() # Revenue\nfinancials.get_net_income() # Net income\nfinancials.get_operating_income() # Operating income\nfinancials.get_total_assets() # Total assets\nfinancials.get_total_liabilities() # Total liabilities\nfinancials.get_stockholders_equity() # Shareholders' equity\nfinancials.get_financial_metrics() # Dict with ratios\n\n# ── Convert to DataFrame ──\nstatement = financials.income_statement()\ndf = statement.to_dataframe() # Full pandas DataFrame\n\n# ── Quarterly financials (from 10-Q) ──\nq_fin = Company(\"AAPL\").get_quarterly_financials()\nq_fin.income_statement() # Quarterly income statement\n```" |
311 | 266 | }, |
312 | 267 | { |
313 | 268 | "cell_type": "markdown", |
|
0 commit comments