u/Beneficial_Baby5458

▲ 9 r/quant

Hi everyone,

Some update on PibouFilings. It is a Python library I built and maintain for pulling and parsing SEC filings (insider trades + fund holdings) from 1990 to today, in SQL, with a single function call.

I've personally used it to understand who I am trading against. There are clear patterns of stock volatility based on who is/are the market makers for a stock.

What's new in 0.5.1:

  • DuckDB is the default backend now.

Parsed data lands in a single DuckDB file, one table per dataset, PK-based dedup. Easy to query, fast on tens of millions of holdings rows, no server to run. CSV export is still there if you want it (`export_format="csv"`).

  • Crash-safe resume.

If a run dies mid-download, rerunning skips what's already on disk (both parsed rows and cached raw filings). No more starting over.

  • Form coverage.

13F-HR (institutional holdings), NPORT-P (fund holdings), and Section 16 (Forms 3/4/5 for insider trades).

  • Parallel workers

Auto-bucketed by form type (quarterly for 13F, monthly for NPORT and Section 16).

  • Transparent parsers

You can keep the raw `.txt` filings and post-process them yourself if you don't trust my parsing (create a PR and update the filers ;).

Try it

Install: pip install -U piboufilings

from piboufilings import get_filings

USER_AGENT_EMAIL = "yourname@example.com"  # required by SEC fair-access policy
USER_NAME = "Your Name or Company"

get_filings(
    user_name=USER_NAME,
    user_agent_email=USER_AGENT_EMAIL,
    cik="0001067983",                # Berkshire Hathaway; pass None to get all
    form_type=["13F-HR", "NPORT-P", "SECTION-6"],
    start_year=2020,
    end_year=2025,
    base_dir="./my_sec_data",        # parsed data
    log_dir="./my_sec_logs",         # operation logs
    raw_data_dir="./my_sec_raw_data",# cached raw .txt filings
    keep_raw_files=True,             # set False to drop raw after parsing
    max_workers=5,
    export_format="duckdb",          # "duckdb" (default) or "csv"
)

Repo: https://github.com/Pierre-Bouquet/pibou-filings

u/Beneficial_Baby5458 — 24 days ago