Skip to main content

llm-fragments-us-legislation

PyPI Changelog Tests License

Load bills from Congress.gov as LLM fragments

Installation

Install this plugin in the same environment as LLM.

llm install llm-fragments-us-legislation

Usage

First set the environment variable CONGRESS_API_KEY (sign up for a key here).

Then you can load in a bill like so:

# This bill is yuge, so use a model with enough context!
llm -f bill:hr1-119 'Summarize this bill' -m gemini-2.5-pro-preview-05-06

Bill fragment format

bill:BILL_ID[:OPTION]

Where:

  • BILL_ID follows the format [type][number]-[congress]
    • type: hr (House) or s (Senate)
    • number: Bill number
    • congress: Congress session number
  • OPTION (optional): Specifies what content to retrieve

Basic Examples

# Load full bill text
llm -f bill:hr1-119 'Summarize this bill' -m gemini-2.5-pro-preview-05-06

# Load table of contents only
llm -f bill:hr1-119:toc 'What are the main sections of this bill?'

# Load a specific section
llm -f bill:hr1-119:section-110101 'Is there language in here to prevent fraud?'

# Load multiple sections
llm -f bill:hr1-119:section-80101,80121 'What does this Alaska section do differently than the non-Alaska sections?'

# Store local responses of API calls with DEBUG=1
DEBUG=1 llm -f bill:hr1-119:section-80101,80121 'What does this Alaska section do differently than the non-Alaska sections?'

Available Options

Option Description Example
(none) Full bill text in XML format bill:hr1-119
toc Table of contents only bill:hr1-119:toc
section-N Specific section by number bill:hr1-119:section-1
section-N,M,P Multiple sections bill:hr1-119:section-1,3,5

Bill ID Examples

  • hr1-119 - House Resolution 1 from the 119th Congress
  • s1046-118 - Senate Bill 1046 from the 118th Congress
  • hr2-117 - House Resolution 2 from the 117th Congress

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-fragments-us-legislation
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

Metadata

Release files for llm-fragments-us-legislation 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-fragments-us-legislation 0.1
File Size Uploaded Provenance
llm_fragments_us_legislation-0.1.tar.gz 12.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-fragments-us-legislation 0.1
File Interpreter ABI Platform
llm_fragments_us_legislation-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / llm_fragments_us_legislation-0.1.tar.gz

Download URL llm_fragments_us_legislation-0.1.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cd933d7d85d3e068d1b5148c5e27cc3480b244c77d1d19e5d68f68194eaca9ea
BLAKE2b-256 checksum
How to use checksums
63ef29b2932f47aef73685b4f42ab2c920e3cc86ed053cdb93cb117fcf22c1bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2025.

Transparency log

Release files / llm_fragments_us_legislation-0.1-py3-none-any.whl

Download URL llm_fragments_us_legislation-0.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e52f4297db6eb032bfc7192b9eb092d5befe888c1154a8395c27e25a063eb14
BLAKE2b-256 checksum
How to use checksums
e66d2eb414af321c88897fe47e742943465707da6d90e6514fe806fb79eafc0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2025.

Transparency log

Security for llm-fragments-us-legislation 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llm_fragments_us_legislation-0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page