estimatelaws

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

README

estimatelaws

Go package that embeds the dataset "U.S. State Auto Repair Estimate Laws": one record per U.S. state and the District of Columbia (51 rows), release 2026-10-02. No dependency outside the standard library.

Not legal advice. Verify the official text. This dataset summarizes public legal texts for research and consumer information. Laws change, and a short summary can miss exceptions. Read the official text, or ask a lawyer, before relying on any row.

Install

go get github.com/repairworth/estimatelaws

Use

law, ok := estimatelaws.Lookup("CA")
if ok && law.Status == estimatelaws.Verified {
    fmt.Println(law.StatuteCitation, law.OverrunWithoutNewConsent)
}
for _, l := range estimatelaws.All() {
    fmt.Println(l.Code, l.Status)
}
fmt.Println(estimatelaws.Version)

Status values

Status Meaning Rows
verified The official text was read and the row names a statute or rule. Rule values come from that text. 40
no_statute_found An official source was read on the date given and no dedicated statute was found (official_url, checked_on). This is a negative finding: it cannot be proven by quotation. Rule cells are empty. 4
lead The official text was not read; any citation or reference kept in the record is a pointer to follow up, and the rule fields are empty. 7

An empty field means "not established from the source read". It does not mean "no rule". Only verified rows carry rule values.

Source

The embedded file is data/us-state-auto-repair-estimate-laws.csv. Its SHA-256 is recorded in data/SHA256SUMS and checked by the tests.

License

Code: MIT, see LICENSE. Data in data/: Creative Commons Attribution 4.0 International, see data/LICENSE (https://creativecommons.org/licenses/by/4.0/). The statutes and regulations quoted are government edicts in the public domain.

Documentation

Overview

Package estimatelaws embeds the dataset "U.S. State Auto Repair Estimate Laws": one record for each of the 50 states and the District of Columbia, describing the state law or regulation on written auto repair estimates.

This is not legal advice. Verify the official text before relying on any record: laws change, and a short summary can miss exceptions. A Verified record carries the citation and the URL of the source to read.

Only records whose Status is Verified carry rule values. They were read on an official state source. For a NoStatuteFound record, an official source was read on the date given and no dedicated statute was found (OfficialURL, CheckedOn); an absence cannot be proven by quotation. For a Lead record, the official text was not read; any citation or reference kept in the record is a pointer to follow up, and the rule fields are empty. An empty field means "not established from the source read"; it never means "no rule".

The dataset is compiled and published by RepairWorth:

The code is under the MIT license. The embedded data, in the data directory, is under Creative Commons Attribution 4.0 International.

Index

Examples

Constants

View Source
const Version = "2026-10-02"

Version is the release date of the embedded dataset: the most recent CheckedOn date found in it.

Variables

This section is empty.

Functions

This section is empty.

Types

type Law

type Law struct {
	State  string // jurisdiction name
	Code   string // two-letter USPS code
	Status Status

	HasStatute      string // "yes" or "partial" (Verified), "no" (NoStatuteFound), "" (Lead)
	StatuteCitation string
	OfficialURL     string
	SecondaryURL    string // legal mirror, never used as evidence

	WrittenEstimateRequired string
	// WrittenEstimateThresholdUSD is meaningful only when HasThreshold is true.
	WrittenEstimateThresholdUSD       int
	HasThreshold                      bool
	OverrunWithoutNewConsent          string
	ConsentForm                       string
	ReturnOfReplacedParts             string
	ShopRegistrationRequired          string
	DiagnosticOrTeardownFeeDisclosure string

	VerifiedQuote    string // verbatim quote from the official source
	CheckedOn        string // ISO 8601 date of the reading or of the search
	EffectiveVersion string
	Note             string
}

Law is one row of the dataset. Text fields hold the wording of the dataset; an empty string means "not established from the source read".

func All

func All() []Law

All returns every record, in the order of the dataset. The slice is a copy: the caller may modify it.

Example
fmt.Println(len(All()), "jurisdictions, release", Version)
Output:
51 jurisdictions, release 2026-10-02

func Lookup

func Lookup(code string) (Law, bool)

Lookup returns the record for a two-letter USPS code such as "CA" or "DC". The code is matched without regard to case or surrounding spaces.

Example
law, ok := Lookup("ca")
if !ok {
	return
}
fmt.Println(law.State)
fmt.Println(law.Status)
fmt.Println(law.StatuteCitation)
Output:
California
verified
Cal. Bus. & Prof. Code §9884.9

type Status

type Status string

Status says how far a record can be relied on.

const (
	// Verified: the official text was read and the record names a statute or rule.
	Verified Status = "verified"
	// NoStatuteFound: an official source was read on the date given and no
	// dedicated statute was found.
	NoStatuteFound Status = "no_statute_found"
	// Lead: the official text was not read; any citation or reference kept
	// in the record is a pointer to follow up, and the rule fields are empty.
	Lead Status = "lead"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL