Crates.io | reporters-db |
lib.rs | reporters-db |
version | 0.1.5 |
created_at | 2022-03-27 06:56:27.906985+00 |
updated_at | 2025-09-13 19:48:22.728172+00 |
description | An unoffical port of the freelawproject's database of court reporters. |
homepage | |
repository | https://github.com/jakeswenson/reporters-db |
max_upload_size | |
id | 557182 |
size | 1,743,465 |
A high-performance Rust port of the Free Law Project's comprehensive database of court reporters. This library provides zero-overhead access to legal citation data through compile-time Perfect Hash Functions (PHF).
Add to your Cargo.toml
:
[dependencies]
reporters-db = "0.1.5"
use reporters_db::{get_reporters, get_variations_only, CiteType};
// Get the main reporters database
let reporters = get_reporters();
if let Some(reporter_list) = reporters.get("F.3d") {
for reporter in reporter_list.iter() {
println!("Reporter: {}", reporter.name);
match reporter.cite_type {
CiteType::Federal => println!("This is a federal court reporter"),
CiteType::State => println!("This is a state court reporter"),
_ => println!("Other type: {:?}", reporter.cite_type),
}
}
}
// Get variation mappings
let variations = get_variations_only();
if let Some(canonical_forms) = variations.get("Atlantic Reporter") {
println!("Canonical forms: {:?}", canonical_forms);
}
use reporters_db::{get_names_to_editions, get_regex_variables, get_journals};
// Get reporter name to editions mapping
let names_to_editions = get_names_to_editions();
if let Some(editions) = names_to_editions.get("Atlantic Reporter") {
println!("Atlantic Reporter editions: {:?}", editions);
// Output: ["A.", "A.2d", "A.3d"]
}
// Get regex patterns for citation parsing
let regex_vars = get_regex_variables();
if let Some(template) = regex_vars.get("full_cite") {
println!("Full citation pattern: {}", template.value());
}
// Access journals database
let journals = get_journals();
for (key, journal_list) in journals.entries().take(5) {
println!("Journal '{}' has {} entries", key, journal_list.len());
}
Function | Description |
---|---|
[get_reporters() ] |
Main court reporters database |
[get_variations_only() ] |
Variation to canonical name mappings |
[get_editions() ] |
Edition to parent reporter mappings |
[get_names_to_editions() ] |
Reporter names to edition lists |
[get_journals() ] |
Academic journals and law reviews |
[get_laws() ] |
Statutory law and code publications |
[get_regex_variables() ] |
Citation parsing regex templates |
Reporter
] - Court reporter with editions and metadataCiteType
] - Citation type classification (Federal, State, etc.)Edition
] - Specific edition/series of a reporterJournal
] - Academic legal publicationLaw
] - Statutory law or code referenceThis Rust port provides significant performance improvements over the Python version:
&'static str
referencesCourt reporters are books containing judicial opinions, dating back centuries. Famous early reporters include those by William Cranch and Alexander Dallas. This database catalogs thousands of these publications, from West's reporters to regional series like "Dakota Reports."
The original Python database is maintained by the Free Law Project. This Rust port provides the same comprehensive data with significant performance improvements for systems requiring high-throughput legal citation processing.
This is a port of the original reporters-db Python library. For data corrections or additions, please contribute to the upstream Python project.
For Rust-specific issues, performance improvements, or API enhancements, please open issues in this repository.
This project maintains the same license as the original Free Law Project database.