an extensible tool to process legal citations in text
Project description
CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the relevant law for free. It can be used to quickly look up a reference, or to insert a hyperlink for every long- or short-form citation found in a longer text.
If you want to quickly try it out, it's available as a web app at citation.link.
Here's a sample of the links CiteURL can make:
Federal law provides that courts should award prevailing civil rights plaintiffs reasonable attorneys fees, 42 USC § 1988(b), and, by discretion, expert fees, id. at (c). This is because the importance of civil rights litigation cannot be measured by a damages judgment. See Riverside v. Rivera, 477 U.S. 561 (1986). But Evans v. Jeff D. upheld a settlement where the plaintiffs got everything they wanted, on condition that they waive attorneys' fees. 475 U.S. 717 (1986). This ruling lets savvy defendants create a wedge between plaintiffs and their attorneys, discouraging civil rights suits and undermining the court's logic in Riverside, 477 U.S. at 574-78.
By default, CiteURL supports Bluebook-style citations to over 130 sources of U.S. law, including:
- most reported state and federal court opinions
- the U.S. Code and Code of Federal Regulations
- the U.S. Constitution and all state constitutions
- the codified laws for every state and territory except Arkansas, Georgia, Guam, and Puerto Rico.
You can also add more sources of law by writing your own citation templates in YAML format.
Installation
To install just enough to make CiteURL work, run this command:
python3 -m pip install citeurl
Substitute citeurl[full]
for citeurl
if you want to install the optional dependencies flask
and appdirs
, necessary for hosting citeurl as a website and reading custom templates from the user's home directory.
Usage
CiteURL provides four command-line tools:
citeurl process
: Parse a text and insert an HTML hyperlink for every citation it contains, including shortform citations.citeurl lookup
: Look up a single citation and display information about it.citeurl host
: Host an instance of CiteURL as a web app like citation.link.citeurl makejs
: Export an instance of CiteURL's lookup feature as JavaScript or a static web page. More info is available here.
Each command has its own command-line arguments you can view with the -h
option. They all share the -t
option, which allows you to load a list of custom citation templates in YAML form.
Here are a few common use cases:
# Process a court opinion and output a version where each citation is hyperlinked:
citeurl process -i INPUT_FILE.html -o OUTPUT_FILE.html
# Look up a single citation and open it directly in a browser
citeurl lookup "42 USC 1983" -b
# List the top ten authorities cited in a text, from most citations to least:
cat INPUT_FILE.html | citeurl process -a 10
# Host a lookup tool with custom templates, and serve it on the local network:
citeurl host -t PATH_TO_YOUR_TEMPLATES.YAML -s
CiteURL is also available in a few other forms besides the command-line tool:
- citation.link, the web app
- a flexible Python library
- an extension to Python-Markdown
- a desktop search provider for Linux users with the GNOME shell
Credits
Many thanks to these websites, which CiteURL's default templates frequently link to:
- Harvard's Caselaw Access Project - for most court cases
- CourtListener - for other court cases
- Cornell's Legal Information Institute - for the U.S. Code and many federal rules
- Ballotpedia - for the vast majority of state constitutions
- LawServer.com - for statutes in about a dozen states and territories whose websites don't have a compatible URL scheme
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file citeurl-11.5.1.tar.gz
.
File metadata
- Download URL: citeurl-11.5.1.tar.gz
- Upload date:
- Size: 176.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa196147ab11eea43e2b0127ab6aced97d40b0b7fd14da35b9dd34a39191670a |
|
MD5 | eb45e23cc625ab55489bb5418094569a |
|
BLAKE2b-256 | 47f4ca880ce494e55099811d985aae029dab2c127fd1d8316eefecf257460793 |
File details
Details for the file citeurl-11.5.1-py3-none-any.whl
.
File metadata
- Download URL: citeurl-11.5.1-py3-none-any.whl
- Upload date:
- Size: 243.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74d6739da589ccce1f129f3da9450eb21fbe9eb2589a0c97cbba69e87369cce |
|
MD5 | 32565bb88b217b2c48b0ea1936f83b6a |
|
BLAKE2b-256 | 0229d768f4e1d576031ecc07744386c0b93cb09d2bac24a96e89b85adf28d299 |