unitedstates / inspectors-general

Collecting reports from Inspectors General across the US federal government.
https://sunlightfoundation.com/blog/2014/11/07/opengov-voices-opening-up-government-reports-through-teamwork-and-open-data/
Creative Commons Zero v1.0 Universal
107 stars 21 forks source link

Add new datetime format and turn comparisons into loop #305

Closed RandyMoore closed 6 years ago

RandyMoore commented 6 years ago

I was getting the parsing error running the usps.py scraper. It had an additional timezone (%Z) so I added the format string for that. Then I refactored the code to run in a loop over all the format strings and break out of the loop as soon as it is successful instead of adding another level of nesting. It should be easier for folks to add additional format strings now.

divergentdave commented 6 years ago

This is great, thanks for the fix!