1.5 KiB
1.5 KiB
zfin enrich
Bootstrap a metadata.srf classification
file from public Wikidata + SEC EDGAR data.
Usage: zfin enrich [SYMBOL]
Requires ZFIN_USER_EMAIL (SEC EDGAR needs a contact address). Two
modes:
- Portfolio mode (no argument) -- classify every stock symbol in
your portfolio and write a complete SRF file to stdout. Honors the
global
-pflag for file selection. - Symbol mode (one
SYMBOL) -- emit one appendable line for a single symbol.
Sources
- Wikidata SPARQL -- sector / industry / country / asset class, plus a CIK lookup for the EDGAR call.
- EDGAR XBRL company facts -- shares outstanding, combined with the latest cached close to derive market-cap size buckets for US stocks.
- EDGAR mutual-fund ticker map -- fallback when Wikidata has no
entry (open-end funds aren't exchange-listed); fills in
geo::US,asset_class::Fund.
Examples
zfin enrich > metadata.srf # whole portfolio (default file)
zfin -p sample enrich > metadata.srf # whole portfolio (named file)
zfin enrich AAPL >> metadata.srf # append a single symbol
zfin enrich fagix >> metadata.srf # symbol is auto-uppercased
Always review the output before saving -- symbols that miss both
sources come through as TODO lines to complete by hand.
See also
- Classify your holdings -- the workflow.
metadata.srfreference -- the file this produces.