Load bills from Congress.gov as LLM fragments
Project description
llm-fragments-us-legislation
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_IDfollows the format[type][number]-[congress]type:hr(House) ors(Senate)number: Bill numbercongress: 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 Congresss1046-118- Senate Bill 1046 from the 118th Congresshr2-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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_fragments_us_legislation-0.1.tar.gz.
File metadata
- Download URL: llm_fragments_us_legislation-0.1.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd933d7d85d3e068d1b5148c5e27cc3480b244c77d1d19e5d68f68194eaca9ea
|
|
| MD5 |
62ba95b63daae9d828e917141b4078f4
|
|
| BLAKE2b-256 |
63ef29b2932f47aef73685b4f42ab2c920e3cc86ed053cdb93cb117fcf22c1bd
|
Provenance
The following attestation bundles were made for llm_fragments_us_legislation-0.1.tar.gz:
Publisher:
publish.yml on kevinschaul/llm-fragments-us-legislation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_fragments_us_legislation-0.1.tar.gz -
Subject digest:
cd933d7d85d3e068d1b5148c5e27cc3480b244c77d1d19e5d68f68194eaca9ea - Sigstore transparency entry: 227372782
- Sigstore integration time:
-
Permalink:
kevinschaul/llm-fragments-us-legislation@c3f6a75b180e282d3eb87f7a35d0071945ad136e -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/kevinschaul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3f6a75b180e282d3eb87f7a35d0071945ad136e -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_fragments_us_legislation-0.1-py3-none-any.whl.
File metadata
- Download URL: llm_fragments_us_legislation-0.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e52f4297db6eb032bfc7192b9eb092d5befe888c1154a8395c27e25a063eb14
|
|
| MD5 |
c4e9547a403720124ffa01e71a621923
|
|
| BLAKE2b-256 |
e66d2eb414af321c88897fe47e742943465707da6d90e6514fe806fb79eafc0c
|
Provenance
The following attestation bundles were made for llm_fragments_us_legislation-0.1-py3-none-any.whl:
Publisher:
publish.yml on kevinschaul/llm-fragments-us-legislation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_fragments_us_legislation-0.1-py3-none-any.whl -
Subject digest:
5e52f4297db6eb032bfc7192b9eb092d5befe888c1154a8395c27e25a063eb14 - Sigstore transparency entry: 227372786
- Sigstore integration time:
-
Permalink:
kevinschaul/llm-fragments-us-legislation@c3f6a75b180e282d3eb87f7a35d0071945ad136e -
Branch / Tag:
refs/tags/v0.1 - Owner: https://github.com/kevinschaul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3f6a75b180e282d3eb87f7a35d0071945ad136e -
Trigger Event:
release
-
Statement type: