edtechhub / zotero-cli

Commandline interface for Zotero
https://github.com/edtechhub/zotero-cli/projects/1
13 stars 3 forks source link

Examples - keeping these here so we can check lateron what's still needed #78

Open retorquere opened 5 years ago

retorquere commented 5 years ago
def get_all_items_with_tag(zot, tag=None):
    if filter:
        print("--filter has no effect for this action.")
    items = zot.everything(zot.items(tag=tag))
    for item in items:
        print(json.dumps(item, indent=jsonIndent))

def get_attachment_or_note(zot):
    if filter:
        print("--filter has no effect for this action.")
    items = zot.everything(zot.items(itemType=["-attachment","-note"]))
    print(json.dumps(items, indent=jsonIndent))

Note - this doesn't seem to work!

https://github.com/urschrei/pyzotero/issues/93

def count_items_with_tag(zot, **filter):    
    if filter:
        items = zot.everything(zot.tags(filter))
    else:
        items = zot.everything(zot.tags())
    # print(json.dumps(items, indent=jsonIndent))
    for tag in items:
        items = zot.num_tagitems(tag)
        print(tag + " " + items)