FastFEC is a C parser for raw .fec filings. It has:
- a CLI binary (
fastfec) that writes parsed CSV files - a shared C library (
libfastfec) - a Python wrapper package in
python/that loads the shared library
src/: C source code for parser, CLI, writer, and bundled PCREbuild.zig: Zig build script for CLI, shared lib, and C testsscripts/: mapping generation scripts (generate_mappings.py)python/src/fastfec/: Python wrapper (ctypesclient + utils)python/tests/: Python tests + fixture.fecfiles
- Install Zig (recommended on current macOS):
brew install zig@0.14- Use this Zig in shell for the session:
export PATH="/opt/homebrew/opt/zig@0.14/bin:$PATH"- Verify:
zig versionFrom repo root:
zig buildOutputs:
zig-out/bin/fastfeczig-out/lib/libfastfec.dylib
Parse a local filing:
./zig-out/bin/fastfec -x -s python/tests/fixtures/13360.fec /private/tmp/fastfec_out 13360Notes:
-xdisables stdin and forces file input mode- output files are written under
{output_dir}/{filing_id}/
zig build testFrom repo root:
make helpMain targets:
make build: build CLI + shared librarymake c-test: run C testsmake cli-smoke: parse fixture filing and write CSV output to/private/tmp/fastfec_make_smokemake py-setup: createpython/.venvmake py-install: install Python dev dependenciesmake py-test: run Python tests (tox -e py)make all: run full verification (build,c-test,cli-smoke,py-test)
From repo root:
python3 -m venv python/.venv
source python/.venv/bin/activate
cd python
pip install -r requirements-dev.txtsource python/.venv/bin/activate
cd python
tox -e py- The Python package depends on
ziglang==0.11.0for wheel/build workflows. - On newer macOS, using system
zig 0.11.0directly may fail; building the repo withzig@0.14is the practical path.