Open deklanw opened 3 weeks ago
The changes introduced in the pull request enhance the zotero2readwise
module by adding new command-line arguments for filtering Zotero annotations based on tags. The modifications include a new static method for formatting author lists and updates to class constructors to incorporate filtering capabilities. These changes improve the handling of annotations and authors, allowing for more flexible and modular processing.
Files | Change Summary |
---|---|
zotero2readwise/run.py |
Added --filter_tags and --include_filter_tags command-line arguments; updated handling of filter_colors and filter_tags . |
zotero2readwise/zotero.py |
Introduced format_author_list static method; updated ZoteroAnnotationsNotes constructor to accept filter_tags and modified filtering logic. |
zotero2readwise/zt2rw.py |
Updated class constructor to include filter_tags and include_filter_tags ; changed filter_colors to a sequence type. |
In the garden of code, where rabbits play,
New tags and filters hop into the fray.
With authors formatted, neat and bright,
Zotero's treasures take flight!
So let’s cheer for the changes, oh what a delight! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This PR allows filtering by tags. It plays nicely with the existing color filtering.
So, e.g., I use the tag "rw" for my Readwise syncing. Highlights with that tagged get synced. By default those tags get stripped before inclusion on Readwise, but they can be left with a flag.
I made two other necessary fixes:
1) According to poetry your lock file was out of date from your pyproject.toml, so I reran lock 2) The logic for keeping the author list string below 1024 was incorrect. (See e.g. https://arxiv.org/abs/2403.17297 for an example of a failing author list). It didn't accomplish that and also reversed the author order incorrectly. I made the simplifying assumption that each individual author string has length <= 256 (forced by truncation), a reasonable assumption I hope. Otherwise the logic gets really hairy.
Summary by CodeRabbit
New Features
--filter_tags
and--include_filter_tags
command-line arguments for enhanced filtering of Zotero annotations.Improvements
These updates improve user experience by providing greater flexibility and control over annotation management.