Skip to content

Commit

Permalink
updated tests and years; changed sources for Colorado Revised Statutes
Browse files Browse the repository at this point in the history
  • Loading branch information
raindrum committed Feb 22, 2024
1 parent b7cb2b1 commit 1113e23
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 34 deletions.
25 changes: 8 additions & 17 deletions citeurl/templates/state law.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,11 @@ California Building Code:
lpad: 2


Colorado Revised Statutes: # model for title-article-section citations needing yearly updates
Colorado Revised Statutes:
meta:
name regex: Colo(rado|\.)|CO
abbreviation: Colo. Rev. Stat.
tokens:
year:
regex: \d+
default: '2021' # needs yearly updates
title: *digits_dots_letter
article: *digits_dots_letter
section: *digits_dots_letter
Expand All @@ -530,16 +527,7 @@ Colorado Revised Statutes: # model for title-article-section citations needing y
parts: ['{abbreviation} § {title}-{article}-{section}', '{subsection}']
URL builder:
parts: ['https://leg.colorado.gov/sites/default/files/images/olls/crs{supported_year}-title-{lpad_title}.pdf#search={title}-{article}-{section}.']
edits:
- token: title
lpad: 2
output: lpad_title
- token: year
output: supported_year
sub: ['', '']
- token: supported_year # force pre-2013 to current year
lookup: {'1[89]\d{2}|200\d|201[0-2]':'2021'} # needs yearly updates
mandatory: no
parts: ['https://colorado.public.law/statutes/crs_{title}-{article}-{section}']


Colorado Constitution:
Expand Down Expand Up @@ -632,7 +620,7 @@ Florida Statutes: # model for chapter.section citations
meta:
name regex: (Fl(orida|a?\.)|FL)
abbreviation: Fla. Stat.
year: '2021' # needs yearly updates
year: '2023' # needs yearly updates
tokens:
chapter: *digits_letter
section: *digits_letter
Expand Down Expand Up @@ -798,7 +786,7 @@ Indiana Code: # model for title-article-chapter-section citations
meta:
name regex: Ind(iana|\.)|IN
abbreviation: Ind. Code
year: '2021' # needs yearly updates
year: '2023' # needs yearly updates
tokens:
title: {regex: \d+}
article: *digits_dots_letter
Expand Down Expand Up @@ -1728,9 +1716,12 @@ Oklahoma Statutes:
meta:
name regex: Okla(homa|\.)?|OK
abbreviation:
year: '2021' # needs yearly updates
year: '2022' # needs yearly updates
URL builder:
parts: ['https://law.justia.com/codes/oklahoma/{year}/title-{title}/section-{title}-{section}/index.html']
edits:
- token: section
sub: ['\.', '-']


Oklahoma Constitution:
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ <h1>404 - Not found</h1>
</div>


<script id="__config" type="application/json">{"base": "/", "features": [], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.0"}</script>
<script id="__config" type="application/json">{"base": "/", "features": [], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.1"}</script>


<script src="/assets/javascripts/bundle.8fd75fb4.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/frontends/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ <h2 id="gnome-shell-search-provider">GNOME Shell Search Provider</h2>
</div>


<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.0"}</script>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.1"}</script>


<script src="../assets/javascripts/bundle.8fd75fb4.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ <h2 id="credits">Credits</h2>
</div>


<script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.0"}</script>
<script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.1"}</script>


<script src="assets/javascripts/bundle.8fd75fb4.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/library/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7039,7 +7039,7 @@ <h2 id="citeurl.StringBuilder.to_dict" class="doc doc-heading">
</div>


<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.0"}</script>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.1"}</script>


<script src="../assets/javascripts/bundle.8fd75fb4.min.js"></script>
Expand Down
Binary file modified docs/sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/template-yamls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ <h3 id="template-inheritance">Template Inheritance</h3>
</div>


<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.0"}</script>
<script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "11.3.1"}</script>


<script src="../assets/javascripts/bundle.8fd75fb4.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ markdown_extensions:
- pymdownx.superfences

extra:
version: 11.3.0
version: 11.3.1
history_buttons: false
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name = 'citeurl',
version = '11.3.0',
version = '11.3.1',
description = 'an extensible tool to process legal citations in text',
author = 'Simon Raindrum Sherred',
author_email = 'simonraindrum@gmail.com',
Expand Down
24 changes: 14 additions & 10 deletions tests/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"tests for individual citation templates. not all of them are ready yet"

#import requests
#import time
# import requests
# import time

from citeurl import Citator

Expand Down Expand Up @@ -32,7 +32,7 @@
},
"U.S. Statutes at Large": {
"cite": "120 Stat. 3754",
"URL": "https://www.govinfo.gov/content/pkg/STATUTE-120/pdf/STATUTE-120-Pg3754.pdf",
"URL": "https://www.govinfo.gov/content/pkg/STATUTE-120/html/STATUTE-120-Pg3754.htm",
"shortform": None,
"shortform_URL": None,
},
Expand Down Expand Up @@ -248,9 +248,9 @@
},
"Colorado Revised Statutes": { # needs yearly updates
"cite": "Colo. Rev. Stat. § 8-2-113",
"URL": "https://leg.colorado.gov/sites/default/files/images/olls/crs2021-title-08.pdf#search=8-2-113.",
"URL": "https://colorado.public.law/statutes/crs_8-2-113",
"shortform": "§ 8-2-112",
"shortform_URL": "https://leg.colorado.gov/sites/default/files/images/olls/crs2021-title-08.pdf#search=8-2-112."
"shortform_URL": "https://colorado.public.law/statutes/crs_8-2-112"
},
"Colorado Constitution": {
"cite": "Colo. Const. Art. XIX, Sec. 2",
Expand Down Expand Up @@ -296,9 +296,9 @@
},
"Florida Statutes": { # needs yearly updates
"cite": "Fla. Stat. § 285.16",
"URL": "https://www.flsenate.gov/Laws/Statutes/2021/0285.16",
"URL": "https://www.flsenate.gov/Laws/Statutes/2023/0285.16",
"shortform": "§ 285.20",
"shortform_URL": "https://www.flsenate.gov/Laws/Statutes/2021/0285.20"
"shortform_URL": "https://www.flsenate.gov/Laws/Statutes/2023/0285.20"
},
"Florida Constitution": {
"cite": "Florida Constitution Article X, Section 2",
Expand Down Expand Up @@ -368,9 +368,9 @@
},
"Indiana Code": { # needs yearly updates
"cite": "Ind. Code § 9-22-3-2.5",
"URL": "https://iga.in.gov/legislative/laws/2021/ic/titles/09#09-22-3-2.5",
"URL": "https://iga.in.gov/legislative/laws/2023/ic/titles/09#09-22-3-2.5",
"shortform": "§ 9-22-3-3",
"shortform_URL": "https://iga.in.gov/legislative/laws/2021/ic/titles/09#09-22-3-3"
"shortform_URL": "https://iga.in.gov/legislative/laws/2023/ic/titles/09#09-22-3-3"
},
"Indiana Constitution": {
"cite": "Indiana Constitution Article XIII, Section 1",
Expand Down Expand Up @@ -420,9 +420,13 @@ def test_url_generation():

print('OK')

def do_not_test_urls_validity(): # disabled to avoid server load
def DO_NOT_test_urls_validity(): # disabled to avoid server load
"make sure CiteURL's URLs generally don't go to error pages"
print('Checking whether test URLs still return valid response codes...')

import requests
import time

for template_name, template in TESTS.items():
print(f"{template['cite']} ... ", end='')
if not template.get('URL'):
Expand Down

0 comments on commit 1113e23

Please sign in to comment.