bellingcat / auto-archiver

Automatically archive links to videos, images, and social media content from Google Sheets (and more).
https://pypi.org/project/auto-archiver/
MIT License
489 stars 53 forks source link

Whitelist and Blacklist of Worksheet #47

Closed djhmateer closed 1 year ago

djhmateer commented 2 years ago

We have a spreadsheet with multiple worksheets and I'd like to whitelist or blacklist based on the title.

The reason is that one of the worksheets is an exact copy of the worksheet that I want archived, with the same column names. So the archiver picks it up when we don't want it.

I propose adding 2 extra config items, something like this:

execution:
  # spreadsheet name - can be overwritten with CMD --sheet=
  sheet: "Test Hashing"

  # worksheet to blacklist. Leave blank which is default for none. Useful if users want a MASTERSHEET exact copy of the 
  # working worksheet
  worksheet_blacklist: MASTERSHEET
  # only check this worksheet rather than iterating through all worksheets in the spreadsheet. If whitelist is used 
  # then blacklist is ignored as whitelist is most restrictive.
  worksheet_whitelist: Sheet1

I only need a single items in the 'lists'.

Happy to code this up and do a PR.

djhmateer commented 1 year ago

Coded this and like the feature (I generally use the whitelist). Will PR soon.

djhmateer commented 1 year ago

This is in the Dev branch and working well :-)