Registry / search / eyecite

eyecite

JSON →
library2.7.6pypypi✓ verified 88d ago

A tool for extracting legal citations from text strings. Version 2.7.6 supports Python >=3.10, with a focus on US legal materials. Released irregularly by the Free Law Project.

pip install eyecite
INSTALL
IMPORT
SIG · EYECITE
E
eyecite
searchpythonv2.7.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_citations
✓ from eyecite import get_citations
✗ from eyecite.eyecite import get_citations
get_citations is a top-level function, not in a submodule.
resolve_citations
✓ from eyecite import resolve_citations
Direct import works, but note the function changed behavior in v2.0.
annotate
✓ from eyecite import annotate
annotate is also top-level.

Extract all citations from a string. Returns a list of Citation objects.

from eyecite import get_citations text = "See e.g., Roe v. Wade, 410 U.S. 113 (1973)." citations = get_citations(text) for cite in citations: print(cite) # <Citation: 410 U.S. 113>
Debug
Known issues
breakingIn version 2.0, `get_citations` returns a list of `Citation` objects instead of strings. Code relying on string output will break.
fix
Access citation text via str(cite) or cite.citation.
affects: >=2.0.0
breakingThe `clean_text` parameter was removed in 2.0. Text cleaning must be done manually before calling `get_citations`.
fix
Preprocess text as needed (e.g., remove non-citation markup).
affects: >=2.0.0
deprecatedThe `eyecite.helpers` module is deprecated and will be removed in a future version. Use `eyecite` top-level functions instead.
fix
Import functions directly from eyecite.
affects: >=2.6.0
gotchaCitations are parsed in the order they are found, not by occurrence in text. Sorting by position may need manual intervention.
fix
Use the `index` attribute on Citation objects to get the start position.
affects: all
gotchaThe library does not handle all foreign citation formats. Only US legal reporters are fully supported.
fix
For non-US citations, consider alternative libraries or custom reporters.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'get_citations' from 'eyecite'
Installed version <2.0 where `get_citations` was in a submodule or named differently.
fix
Upgrade eyecite: pip install --upgrade eyecite
AttributeError: 'list' object has no attribute 'cite'
Old code assumed `get_citations` returns strings, but it returns objects.
fix
Update code: for cite in citations: print(cite.citation)
Upgrade
Version history
2.7.6latest on PyPI · released Jun 25, 2025
Audit
Dependencies
reporters-dbrequiredProvides the list of legal reporters for citation matching.
Agent activity
46 hits · last 30 days
node
40
Resources
eyecite — pip install eyecite · libregistry