Package: zotero-cli-tool
Zotero CLISort and rank your Zotero references easy from your CLI.Ask questions to your Zotero documents with GPT locally.ThisTinyscripttool relies onpyzoterofor communicating withZotero's Web API. It allows to list field values, show items in tables in the CLI or also export sorted items to an Excel file.$ pip install zotero-cli-toolQuick StartThe first time you start it, the tool will ask for your API identifier and key. It will cache it to~/.zotero/creds.txtwith permissions set torwfor your user only. Data is cached to~/.zotero/cache/. If you are using a shared group library, you can either pass the "-g" ("--group") option in yourzotero-clicommand or, for setting it permanently, touch an empty file~/.zotero/group.Manually update cached data$zotero-cliresetNote that it could take a while. That's why caching is interesting for further use.Count items in a collection$zotero-clicount--filter"collections:biblio"123List values for a given field$zotero-clilistitemTypeType----computerprogramconferencepaperdocumentjournalarticlemanuscriptthesiswebpageShow entries with the given set of fields, filtered based on multiple critera and limited to a given number of items$zotero-clishowyeartitleitemTypenumPages--filter"collections:biblio"--filter"title:detect"--limit">date:10"YearTitleType#Pages-------------------2016ClassifyingPackedProgramsasMaliciousSoftwareDetectedconferencepaper32016DetectingPackedExecutableFile:SupervisedorAnomalyDetectionMethod?conferencepaper52016Entropyanalysistoclassifyunknownpackingalgorithmsformalwaredetectionconferencepaper212017PackerDetectionforMulti-LayerExecutablesUsingEntropyAnalysisjournalarticle182018SensitivesystemcallsbasedpackedmalwarevariantsdetectionusingprincipalcomponentinitializedMultiLayersneuralnetworksjournalarticle132018Effective,efficient,androbustpackingdetectionandclassificationjournalarticle152019Efficientautomaticoriginalentrypointdetectionjournalarticle142019All-in-OneFrameworkforDetection,Unpacking,andVerificationforMalwareAnalysisjournalarticle162020ExperimentalComparisonofMachineLearningModelsinMalwarePackingDetectionconferencepaper32020Buildingasmartandautomatedtoolforpackedmalwaredetectionsusingmachinelearningthesis99Export entries$zotero-cliexportyeartitleitemTypenumPages--filter"collections:biblio"--filter"title:detect"--limit">date:10"$fileexport.xlsxexport.xlsx:MicrosoftExcel2007+Use a predefined query$zotero-clishow---query"top-50-most-relevants"Note: "-" is used for thefieldpositional argument to tell the tool to select the predefined list of fields included in the query.This is equivalent to:$zotero-clishowyeartitlenumPagesitemType--limit">rank:50"Available queries:no-attachment: list of all items with no attachment ; displayed fields:titleno-url: list of all items with no URL ; displayed fields:year,titletop-10-most-relevants: top-10 best ranked items ; displayed fields:year,title,numPages,itemTypetop-50-most-relevants: same as top-10 but with the top-50Mark items:$zotero-climarkread--filter"title:a nice paper"$zotero-climarkunread--filter"title:a nice paper"Markers:read/unread: by default, items are displayed in bold ; marking an item as read will make it display as normalirrelevant/relevant: this allows to exclude a result from the output list of itemsignore/unignore: this allows to completely ignore an item, including in the ranking algorithmLocal GPTThis feature is based onPrivateGPT. It can be used to ingest local Zotero documents and ask questions based on a chosen GPT model.Install optional dependencies$pipinstallzotero-cli-tool[gpt]Install a model among the followings:ggml-gpt4all-j-v1.3-groovy.bin(default)ggml-gpt4all-l13b-snoozy.binggml-mpt-7b-chat.binggml-v3-13b-hermes-q5_1.binggml-vicuna-7b-1.1-q4_2.binggml-vicuna-13b-1.1-q4_2.binggml-wizardLM-7B.q4_2.binggml-stable-vicuna-13B.q4_2.binggml-mpt-7b-base.binggml-nous-gpt4-vicuna-13b.binggml-mpt-7b-instruct.binggml-wizard-13b-uncensored.bin$zotero-cliinstallThe latest installed model gets selected for theaskcommand (see hereafter).Ingest your documents$zotero-cliingestAsk questions to your documents$zotero-cliask
UsingembeddedDuckDBwithpersistence:datawillbestoredin:/home/morfal/.zotero/db
Foundmodelfile.[...]Enteraquery:Special FeaturesSome additional fields can be used for listing/filtering/showing/exporting data.Computed fieldsauthors: the list ofcreatorswithcreatorTypeequal toauthorcitations: the number of relations the item has to other items with a later dateeditors: the list ofcreatorswithcreatorTypeequal toeditornumAttachments: the number of child items withitemTypeequal toattachmentnumAuthors: the number ofcreatorswithcreatorTypeequal toauthornumCreators: the number ofcreatorsnumEditors: the number ofcreatorswithcreatorTypeequal toeditornumNotes: the number of child items withitemTypeequal tonotenumPages: the (corrected) number of pages, either got from the original orpagesfieldreferences: the number of relations the item has to other items with an earlier dateyear: the year coming from thedatetimeparsing of thedatefieldExtracted fields (from theextrafield)comments: custom field for adding commentsresults: custom field for mentioning results related to the itemwhat: custom field for a short description of what the item is aboutzscc: number of Scholar citations, computed with theZotero Google Scholar CitationspluginPageRank-based reference ranking algorithmrank: computed field aimed to rank references in order of relevance ; this uses an algorithm similar to Google's PageRank while weighting references in function of their year of publication (giving more importance to recent references, which cannot have as much citations as older references anyway)