Skip to main content

Load bills from Congress.gov as LLM fragments

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_fragments_us_legislation-0.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_fragments_us_legislation-0.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_fragments_us_legislation-0.1.tar.gz.

File metadata

File hashes

Hashes for llm_fragments_us_legislation-0.1.tar.gz
Algorithm Hash digest
SHA256 cd933d7d85d3e068d1b5148c5e27cc3480b244c77d1d19e5d68f68194eaca9ea
MD5 62ba95b63daae9d828e917141b4078f4
BLAKE2b-256 63ef29b2932f47aef73685b4f42ab2c920e3cc86ed053cdb93cb117fcf22c1bd

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llm_fragments_us_legislation-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_fragments_us_legislation-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e52f4297db6eb032bfc7192b9eb092d5befe888c1154a8395c27e25a063eb14
MD5 c4e9547a403720124ffa01e71a621923
BLAKE2b-256 e66d2eb414af321c88897fe47e742943465707da6d90e6514fe806fb79eafc0c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page