We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to construct a query with negations, such as finding messages which are NOT starred.
construct_query takes in a dictionary that supports various boolean labels, but setting them to False does not add the negation operator (-).
-
>>> construct_query({"starred": True}) 'is:starred' >>> construct_query({"starred": False}) 'is:starred' >>> construct_query({ "starred": False, "snoozed": False, "unread": False, "important": False, "attachment": False, "drive": False, "docs": False, "sheets": False, "slides": False }) '(is:starred is:snoozed is:unread is:important has:attachment has:drive has:document has:spreadsheet has:presentation)'
>>> construct_query({"starred": True}) 'is:starred' >>> construct_query({"starred": False}) '-is:starred' >>> construct_query({ "starred": False, "snoozed": False, "unread": False, "important": False, "attachment": False, "drive": False, "docs": False, "sheets": False, "slides": False }) '(-is:starred -is:snoozed -is:unread -is:important -has:attachment -has:drive -has:document -has:spreadsheet -has:presentation)'
The text was updated successfully, but these errors were encountered:
As a workaround for now, you can compose these queries manually, ie
construct_query({"exact_phrase": "-is:starred"})
This does add quotes to the query string ("-is:starred" vs -is:starred) but Gmail doesn't seem to mind.
"-is:starred"
-is:starred
Sorry, something went wrong.
No branches or pull requests
I would like to construct a query with negations, such as finding messages which are NOT starred.
construct_query takes in a dictionary that supports various boolean labels, but setting them to False does not add the negation operator (
-
).Actual:
Expected:
The text was updated successfully, but these errors were encountered: