Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The API currently exposes bill metadata and source/download links, not extracted bill body text. The ingestion pipeline in scripts/ingest_full_text.py turns those links into analysis-ready local datasets.

Inputs

The pipeline uses the hosted API by default: https://open-congress-api.bettergov.ph/api.

Override the API URL with:

export OPEN_CONGRESS_API_BASE_URL=https://open-congress-api.bettergov.ph/api

Run

Metadata only:

python -m scripts.ingest_full_text --metadata-only

Small smoke test:

python -m scripts.ingest_full_text --congress 20 --limit 25

Full ingestion:

python -m scripts.ingest_full_text

Useful filters:

python -m scripts.ingest_full_text --congress 20 --type HB
python -m scripts.ingest_full_text --congress 19 --type SB --force

Outputs

All generated files are written under data/ingested/, which is ignored by git.

PathPurpose
raw/api/documents.jsonlRaw API bill metadata
raw/pdf/*.pdfDownloaded source PDFs
processed/text/*.txtExtracted text per source PDF
processed/tables/bill_metadata.csvFlattened bill metadata
processed/tables/bill_texts.csvMetadata plus full_text and analysis_text
processed/tables/bill_texts.jsonlJSONL version for downstream NLP
processed/tables/bill_texts.parquetParquet version when pyarrow is available
manifests/downloads.csvDownload status, content type, byte size, hash, errors
manifests/text_extraction.csvExtraction status, page count, character count, errors
manifests/summary.jsonRun summary

Robustness Features

Limitations

Add an OCR fallback for records where has_full_text = false but a PDF was downloaded successfully. A practical stack is ocrmypdf plus Tesseract for OCR and pypdf for final text extraction.