#citation #url #bills

capitol

Parse United States Congress legislative document citations

3 releases

new 0.2.2 Mar 19, 2025
0.2.1 Mar 3, 2025
0.2.0 Jan 27, 2025
0.1.0 Jan 17, 2025

#5 in #citation

Download history 96/week @ 2025-01-14 84/week @ 2025-01-21 40/week @ 2025-01-28 24/week @ 2025-02-04 17/week @ 2025-02-18 86/week @ 2025-02-25 90/week @ 2025-03-04 15/week @ 2025-03-11 149/week @ 2025-03-18

349 downloads per month

MIT license

20KB
456 lines

Capitol

Capitol is a Rust library for converting citation strings for United States Congressional documents of the form <Congress><ObjectType><ObjectNumber>, e.g., 118hr815 representing the H.R.815 in the 118th Congress, into Rust types. These Rust types can be printed as Congress.gov URLs.

This project is in its earliest stage of development, but potential future uses include:

  • a polars extension for parsing GPO package ids returned via the GovInfo API into Congress.gov URLs
  • a typst extension for citing Congressional legislation and hyperlinking to referenced bills

As of this writing, only citations for bills and resolutions and commitee reports from either chamber are implemented. For example, calling Citation::parse with the argument 118hr815 returns this Rust struct:

Citation {
    congress: Congress(118),
    chamber: Chamber::House,
    object_type: CongObjectType::HouseBill,
    number: 815,
    ver: None
}

Calling to_url on that struct return https://www.congress.gov/bill/118th-congress/house-bill/815.

Installation

Capitol is available from crates.io.

No runtime deps