Skip to content

Instantly share code, notes, and snippets.

View willjobs's full-sized avatar

Will Jobs willjobs

View GitHub Profile
@willjobs
willjobs / medium-public-comments-07.py
Created July 25, 2021 16:10
medium-public-comments-07
# get the comment headers for these criteria
params = {"filter[lastModifiedDate][ge]": "2017-01-01 00:00:00", # API for dockets doesn't have postedDate filter
"filter[lastModifiedDate][le]": "2020-12-31 23:59:59", # also, these times are in Eastern time zone
"filter[agencyId]": "EPA",
"filter[searchTerm]": "water"}
# this will download the headers 250 dockets at a time, and save the headers into a CSV
# (you could also save them into a SQLite database)
downloader.gather_headers("dockets", params, csv_filename="EPA_water_dockets.csv")
@willjobs
willjobs / medium-public-comments-08.py
Created July 25, 2021 16:11
medium-public-comments-08
docket_ids = downloader.get_ids_from_csv("EPA_water_dockets.csv", data_type="dockets")
for docket_id in my_dockets:
print(f"\n********************************\nSTARTING {docket_id}\n********************************")
downloader.gather_comments_by_docket(docket_id, csv_filename="EPA_water_comments.csv")
@willjobs
willjobs / exiftool snippets.txt
Created November 26, 2022 22:18
exiftool snippets
#### Rename all images in current directory according to the CreateDate date and time, adding a copy number with leading '-' if the file already exists (%-c), and preserving the original file extension (%e).
# Note the extra '%' necessary to escape the filename codes (%c and %e) in the date format string.
exiftool '-FileName<CreateDate' -d '%Y%m%d %H%M%S%%-c.%%e' .
#### Shift values of CreateDate by 2 years, 9 months and 14 days. 0 hours, minutes and seconds
exiftool "-CreateDate+=2:9:14 0:0:0" -m .
#### View all time info about a given file:
## System:
# FileModifyDate