Skip to main content

an extensible tool to process legal citations in text

Project description

CiteURL Logo

pytest GitHub issues GitHub license PyPI

CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the cited language for free. It can be used to quickly look up a reference, or to insert a hyperlink for every long- or short-form citation 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 state and federal court cases
  • 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

python3 -m pip install citeurl

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:

Credits

Many thanks to these websites, which CiteURL's default templates frequently link to:

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

citeurl-10.0.7.tar.gz (66.4 kB view details)

Uploaded Source

Built Distribution

citeurl-10.0.7-py3-none-any.whl (70.4 kB view details)

Uploaded Python 3

File details

Details for the file citeurl-10.0.7.tar.gz.

File metadata

  • Download URL: citeurl-10.0.7.tar.gz
  • Upload date:
  • Size: 66.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for citeurl-10.0.7.tar.gz
Algorithm Hash digest
SHA256 bf5ad6cfb17923e558033225232c988e4bf46537e9ea56967039be1f991c2c52
MD5 50e944e67910a80bb5898d08dcdf3883
BLAKE2b-256 cd0e5299df974e1fae13568fee3aaa6ab2f8f6fbe895770f0932f9f9b78d5d66

See more details on using hashes here.

File details

Details for the file citeurl-10.0.7-py3-none-any.whl.

File metadata

  • Download URL: citeurl-10.0.7-py3-none-any.whl
  • Upload date:
  • Size: 70.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for citeurl-10.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3f56c19acb9abd375edf65bf2807c8b465d826382de7ffa88afdb8a17fccd108
MD5 4de3d689865b6545028d436afb7027a8
BLAKE2b-256 f9cd2eb7c2867a2a3aae598bb86a6633c3d2540e99e55cfb949ccb3a88db3a48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page