Management commands¶
Every
manage.pycommand the Django apps ship, grouped by app, with its help text and options — read fromsrc/*/management/commands/*.py.
Run them from src/: cd src && python manage.py <command> [options]. python manage.py help <command> prints the full argument help, including defaults.
enrichment¶
| Command | Purpose | Options |
|---|---|---|
build_enrichment_reference |
Rebuild data/reference/enrichment/iso3166.json from pycountry and friends. | --out, --dry-run |
enrich_evidence |
Show why a record says what it says. | --dataset (required), --name (required) |
enrich_export |
Write the MDM export for a dataset. | --dataset (required), --out (required) |
enrich_init |
Create or refresh an enrichment dataset from a CSV list of organizations. | --dataset (required), --csv (required), --name, --mapping, --key, --encoding |
enrich_link |
Attach enrichment records to warehouse Company rows via their verified CIK. | --dataset (required), --no-create |
enrich_plan |
Print the provider wave order for a dataset without running anything. | --dataset (required), --search, --no-web |
enrich_report |
Print coverage, trust and per-provider outcomes for a dataset. | --dataset, --json |
enrich_resolve |
Rebuild the golden record for a dataset from its current claims. | --dataset (required) |
enrich_run |
Run enrichment providers over a dataset. Resumable: every (record, provider) attempt is checkpointed, so re-running only does what has not been done. | --dataset (required), --limit, --only, --refresh, --workers, --max-fetch, --max-search, --max-api, --search, --no-web, --searx, --user-agent-email |
public_data¶
| Command | Purpose | Options |
|---|---|---|
load_series_bundle |
Load a JSON bundle definition into SeriesBundle + ExternalSeries registry. | --file |
refresh_series_bundles |
Load all bundle JSONs in the bundles dir and sync their observations. | --dir, --no-sync, --delay, --days-back |
sync_series_bundle |
Fetch observations for all series in a named bundle (requires FRED_API_KEY for FRED). | --slug, --days-back, --delay |
sync_series_vintage |
Fetch and store a FRED series as known on a past date (ALFRED vintage); needs ENABLE_FRED_VINTAGES and FRED_API_KEY. | --series (required), --as-of (required) |
sec_edgar¶
| Command | Purpose | Options |
|---|---|---|
bulk_load_edgar_companies |
Bulk load basic company rows (CIK, ticker, name) from SEC company_tickers.json into the warehouse. | --update-existing, --refresh-sec-json, --dry-run |
bulk_load_edgar_zip |
Load SEC nightly bulk ZIPs (submissions.zip, companyfacts.zip) into warehouse Filing and Fact rows. Submissions are applied before facts when both are selected. | --submissions-only, --facts-only, --both, --submissions-zip, --facts-zip, --submissions-url, --facts-url, --cache-dir, --only-existing-companies, --cik, --start-after-cik, --limit, --dry-run, --delay-seconds |
generate_edgar_reference |
Regenerate data/reference/*.json from SEC EDGAR APIs (companyfacts, submissions, companyconcept). Requires a valid User-Agent contact (USER_AGENT_EMAIL). Preserves hand-authored schema text; merges live observations and concept labels. | --cik, --ticker, --metadata-cik, --reference-dir, --delay, --with-accounting |
ingest_htm |
Ingest an HTM filing into the warehouse (shared service with API). | --url (required), --ticker, --cik |
ingest_submission |
Download a full SEC submission .txt and decompose it into FilingDocument rows. | --url (required), --ticker, --cik, --no-extract |
sync_accounting_reference |
Merge data/reference/sources/accounting/acct_facts.csv and acct_facts_overlay.json into data/reference/generated/us_gaap_account_map.json (overlay wins per concept). | --accounting-sources-dir, --reference-dir |
sync_company_facts |
Fetch SEC companyfacts JSON and load into warehouse.Fact for a ticker. | --ticker (required) |
sync_leadership |
Extract leadership positions from a company's recent SEC ownership filings. | --ticker, --cik, --limit |
sync_listed_issuers |
Fetch SEC company_tickers.json and upsert all rows into warehouse.ListedIssuer (DB-first issuer directory). | — |
sync_sic_reference |
Fetch the SEC SIC code list page, parse the HTML table, and write sic_codes.json (default: <project>/data/reference/sic_codes.json). Requires a valid User-Agent contact. | --output, --url |
sync_submissions |
Pull SEC submissions index for a company (CIK) into Filing rows. | --ticker, --cik, --force-refresh |
warehouse¶
| Command | Purpose | Options |
|---|---|---|
analyze_leadership |
LLM analysis of leadership initiatives/quotes from SEC filing text (gated). | --ticker, --cik, --all, --no-persist |
compute_stakeholder_assessment |
Compute the stakeholder-orientation (people-vs-profits) index from XBRL facts. | --ticker, --cik, --all |
generate_static_site |
Render a static, browsable site of company financials with copy/download data. | --output, --ticker, --cik, --all, --limit |
load_crm_companies_json |
Load data/local/companies-clean.json (or path) into CrmCompanyRecord staging rows. Does not call SEC. | <json_path>, --clear |
match_crm_sec_titles |
Match CrmCompanyRecord names to SEC company_tickers.json titles (exact normalized). Sets sec_cik / sec_ticker where unambiguous. | --reset |
populate_edgar_database |
Populate Postgres with SEC directory data, warehouse Company rows, reference files, and optionally bulk ZIP ingestion. Run after migrate on new environments. | --skip-migrate, --skip-listed-issuers, --skip-companies, --skip-reference, --bulk-zip, --bulk-zip-limit, --user-agent-email |
publish_static_site |
Sync companies from SEC EDGAR (submissions, facts, metrics, leadership) and render the static public site — the GitHub Pages publish pipeline. | --tickers, --output, --skip-sync, --sync-only, --all-warehouse, --delay, --leadership-limit, --force-refresh, --base-url, --app-url, --user-agent-email, --skip-macro |
sync_all_companies |
Rate-limited, resumable bulk sync of EDGAR datasets for every company. | --datasets, --delay, --limit, --offset, --with-ticker-only, --leadership-limit, --force, --user-agent-email |
sync_crm_matched_edgar |
For CRM rows with exact SEC title match (sec_cik), upsert Company and sync submissions + optional company facts. Uses delays between requests for SEC rate limits. | --delay, --delay-after-facts, --limit, --skip-facts, --start-after-pk, --dry-run |
sync_derived_metrics |
Compute/refresh DerivedMetric rows for one company or all companies. | --ticker, --cik, --all |