Skip to main content

Module sec

Module sec 

Source
Expand description

SEC EDGAR client for N-PORT filings.

Used by the CLI (backfill, nightly-append) to:

  1. List NPORT-P filings for a given trust CIK.
  2. Filter those filings to a target series ID.
  3. Download and parse each filing’s primary_doc.xml.

SEC requires a descriptive User-Agent on all data.sec.gov requests. See https://www.sec.gov/developer for the policy. indexkit sets:

User-Agent: indexkit/1.0 (+https://github.com/userFRM/indexkit)

SEC rate limit is 10 req/s per IP. The fetchers in this module insert a 100 ms sleep between calls for comfortable headroom.

Structs§

FilingRef
One NPORT-P filing reference (not the XML body).
SecClient
Client for the SEC EDGAR submissions and archives APIs.

Constants§

INTER_REQUEST_DELAY
Sleep between SEC requests – 100 ms = 10 req/s = SEC’s stated rate limit.
SEC_USER_AGENT_DEFAULT
User-Agent used for all SEC requests. SEC mandates a contact email and rejects anonymous or noreply@ addresses at the Akamai edge.

Functions§

resolved_sec_user_agent
Resolve the User-Agent to use for SEC requests, honouring INDEXKIT_SEC_USER_AGENT.