eregs / regulations-parser

Parser for U.S. federal regulations and other regulatory information
Creative Commons Zero v1.0 Universal
37 stars 39 forks source link

WIP: Added create-annual-version command #335

Closed cmc333333 closed 7 years ago

cmc333333 commented 7 years ago

See context in #320 -- basic goal is to account for versions before the first known annual edition by explicitly pulling down an annual edition first

cmc333333 commented 7 years ago

When I re-add the dependency, I get an error of:

  File "/workdir/regparser/commands/fetch_annual_edition.py", line 15, in fetch_annual_edition
    xml = volume.find_part_xml(cfr_part).preprocess()
AttributeError: 'NoneType' object has no attribute 'preprocess'

Dropping into debug mode gives more input:

eregs --debug create_annual_version 37 42 2012
[snip]
2016-12-04 06:32:23 requests.packages.urllib3.connectionpool "GET /fdsys/pkg/CFR-2012-title37-vol1/xml/CFR-2012-title37-vol1-part42.xml HTTP/1.1" 404 1877

Indeed, that URL 404s. It doesn't look like FDSYS is aware of 37 CFR 42 in 2012: https://www.gpo.gov/fdsys/browse/collectionCfr.action?collectionCode=CFR&searchPath=Title+37%2FChapter+I&oldPath=Title+37&isCollapsed=true&selectedYearFrom=2012&ycord=1689

Diving deeper, this is because 37 CFR 42 didn't exist in 2012. It was described in 2012-17900 but only went into effect in 2013-09-16. Unfortunately that means this approach won't help us as there wasn't annual editions of data going back far enough.

@eadamsatx I'm going to close this PR and we can regroup in #320