sec-edgar-skill について
sec-edgar-skillは、EdgarToolsを使ってSEC EDGARの提出書類や財務データを取得・分析するスキルです。企業調査や提出状況の監視、企業間比較に向け、XBRLデータと簡潔なコンテキスト要約を活用します。
主な機能
- 01書式と日付で提出書類を取得
- 02企業情報と最新提出書類を確認
- 03複数期間の財務諸表とXBRLデータにアクセス
- 04提出書類本文を検索
- 05Form 4のインサイダー取引を分析
- 06簡潔なコンテキスト要約から確認
活用シーン
- 01複数企業の売上推移を比較
- 02最新の10-K年次報告書を分析
- 03Form 4のインサイダー取引を追跡
- 04書式別に最新提出書類を監視
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ rebyteai-template/ rebyte-skills --skill sec-edgar-skillインストール後、Claude Code で/sec-edgar-skillを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
.gitignoreREADME.mdrequirements.txtreference/form-types.mdobjects.mdworkflows.md詳細
SEC EDGAR スキル - 提出書類の分析
前提条件
重要:EdgarTools の操作を行う前に、必ずこのセットアップを実行してください:
from edgar import set_identity
set_identity("Your Name [email protected]") # SEC requires identification
これはSEC の法的要件です。セットアップを行わないと、操作は失敗します。
インストール
EdgarTools をインストールする必要があります:
pip install edgartools
トークン効率化の戦略
必ず最初に .to_context() を使用してください。これにより、トークン数を 56~89%削減しながら概要を確認できます。
| オブジェクト | repr() のトークン数 | .to_context() のトークン数 | 削減率 |
|---|---|---|---|
| Company | ~750 | ~75 | 90% |
| Filing | ~125 | ~50 | 60% |
| XBRL | ~2,500 | ~275 | 89% |
| Statement | ~1,250 | ~400 | 68% |
ルール: まず .to_context() を呼び出して利用可能な情報を把握し、その後で詳細を確認してください。
提出書類にアクセスする 3 つの方法
1. 公開済みの提出書類 - 複数企業の一括分析
from edgar import get_filings
# Get recent 10-K filings
filings = get_filings(form="10-K")
# Filter by date range
filings = get_filings(form="10-K", year=2024, quarter=1)
# Multiple form types
filings = get_filings(form=["10-K", "10-Q"])
2. 最新の提出書類 - リアルタイム監視
from edgar import get_current_filings
# Get today's filings from RSS feed
current = get_current_filings()
# Filter by form type
current_10k = get_current_filings().filter(form="10-K")
3. 企業別の提出書類 - 単一企業の分析
from edgar import Company
# By ticker
company = Company("AAPL")
# By CIK
company = Company("0000320193")
# Get company's filings
filings = company.get_filings(form="10-K")
latest_10k = filings.latest()
財務データへのアクセス
方法 1:Entity Facts API(高速、複数期間)
期間ごとの傾向を比較する場合に最適です:
company = Company("AAPL")
# Get income statement for multiple periods
income = company.income_statement(periods=5)
print(income) # Shows 5 years of data
# Get balance sheet
balance = company.balance_sheet(periods=3)
# Get cash flow
cashflow = company.cash_flow_statement(periods=3)
方法 2:提出書類の XBRL(詳細、単一期間)
単一の提出書類を包括的に分析する場合に最適です:
company = Company("AAPL")
filing = company.get_filings(form="10-K").latest()
# Get XBRL data
xbrl = filing.xbrl()
# Access financial statements
statements = xbrl.statements
income_stmt = statements.income_statement
balance_sheet = statements.balance_sheet
cash_flow = statements.cash_flow_statement
よくあるワークフロー
ワークフロー 1:複数企業の収益を比較する
from edgar import Company
companies = ["AAPL", "MSFT", "GOOGL"]
for ticker in companies:
company = Company(ticker)
income = company.income_statement(periods=3)
print(f"\n{ticker} Revenue Trend:")
print(income)
ワークフロー 2:最新の 10-K を分析する
from edgar import Company
company = Company("NVDA")
filing = company.get_filings(form="10-K").latest()
# Get filing metadata
print(filing.to_context())
# Get full text (expensive - 50K+ tokens)
# text = filing.text()
# Get specific sections
# items = filing.items() # Risk factors, MD&A, etc.
ワークフロー 3:インサイダー取引を追跡する
from edgar import Company
company = Company("TSLA")
insider_filings = company.get_filings(form="4") # Form 4 = insider trades
for filing in insider_filings[:10]:
print(filing.to_context())
ワークフロー 4:セクター別に最近の提出書類を監視する
from edgar import get_filings
# Get recent tech 10-Ks (use SIC codes)
# SIC 7370-7379 = Computer Programming, Data Processing
filings = get_filings(form="10-K", year=2024)
# Filter by company characteristics after retrieval
ワークフロー 5:複数年にわたる財務の傾向
from edgar import Company
company = Company("AMZN")
# 5-year income statement
income = company.income_statement(periods=20) # 20 quarters = 5 years
# 5-year balance sheet
balance = company.balance_sheet(periods=20)
print("Income Statement Trend:")
print(income)
print("\nBalance Sheet Trend:")
print(balance)
提出書類内を検索する
重要な違い:
filing = company.get_filings(form="10-K").latest()
# Search WITHIN the filing document (finds text in the 10-K)
results = filing.search("climate risk")
# Search API DOCUMENTATION (finds how to use EdgarTools)
docs_results = filing.docs.search("how to extract")
混同しないでください!
主要オブジェクトのリファレンス
Company
company = Company("AAPL")
company.to_context() # Summary with available actions
company.name # Company name
company.cik # CIK number
company.sic # SIC code
company.industry # Industry description
company.get_filings() # Access filings
Filing
filing.to_context() # Summary
filing.form # Form type (10-K, 10-Q, etc.)
filing.filing_date # Date filed
filing.accession_number
filing.text() # Full document text (EXPENSIVE)
filing.markdown() # Markdown format
filing.xbrl() # XBRL financial data
filing.items() # Document sections
XBRL(財務データ)
xbrl = filing.xbrl()
xbrl.to_context() # Summary
xbrl.statements # All financial statements
xbrl.facts # Individual facts/metrics
Statement(財務諸表)
stmt = xbrl.statements.income_statement
print(stmt) # ASCII table format
stmt.to_dataframe() # Pandas DataFrame
避けるべきアンチパターン
しないこと:生のテキストから財務情報を解析する
# BAD - expensive and error-prone
text = filing.text()
# try to regex parse revenue from text...
すること:構造化された XBRL データを使用する
# GOOD - structured and accurate
income = company.income_statement(periods=3)
しないこと:メタデータだけが必要なのに提出書類全体を読み込む
# BAD - wastes tokens
text = filing.text() # 50K+ tokens
すること:まずコンテキストを確認する
# GOOD - minimal tokens
print(filing.to_context()) # ~50 tokens
フォームタイプ早見表
| Form | 説明 | 用途 |
|---|---|---|
| 10-K | 年次報告書 | 年間財務情報、事業内容 |
| 10-Q | 四半期報告書 | 四半期財務情報 |
| 8-K | 臨時報告書 | 重要な事象(M&A、役員の異動) |
| DEF 14A | 委任状説明書 | 役員報酬、取締役会の情報 |
| 4 | インサイダー取引 | インサイダーによる株式取引 |
| 13F | 機関投資家の保有状況 | ヘッジファンドの保有銘柄 |
| S-1 | IPO 登録書類 | IPO 前の提出書類 |
| 424B | 目論見書 | 債券・株式の募集 |
エラー処理
from edgar import Company
try:
company = Company("INVALID")
except Exception as e:
print(f"Company not found: {e}")
# Check if filings exist
filings = company.get_filings(form="10-K")
if len(filings) == 0:
print("No 10-K filings found")
パフォーマンスのヒント
- 取得前にフィルタリングする:フォームタイプや日付フィルターを使用します
- 傾向の分析には Entity Facts API を使用する:複数の提出書類を解析するより高速です
- 一括処理する:ループ内で複数の企業を処理します
- 結果をキャッシュする:頻繁にアクセスするデータを保存します
参考ドキュメント
詳細については、以下を参照してください:
または、組み込みドキュメントを使用してください:
from edgar import Company
company = Company("AAPL")
company.docs.search("how to get revenue")
コメント
Markdown 対応