Pyzotero: a Python client for the Zotero API pyzotero.readthedocs.io
zotero

Merge pull request #257 from urschrei/shugel/push-qqkmtmtuppro

Add version flag and count to JSON output

authored by urschrei.eurosky.social and committed by

GitHub 4c870869 29fec29a

+9 -4
+1 -1
pyproject.toml
··· 1 1 [project] 2 2 name = "pyzotero" 3 - version = "1.7.1" 3 + version = "1.7.2" 4 4 description = "Python wrapper for the Zotero API" 5 5 readme = "README.md" 6 6 requires-python = ">=3.9"
+7 -2
src/pyzotero/cli.py
··· 5 5 6 6 import click 7 7 8 - from pyzotero import zotero 8 + from pyzotero import __version__, zotero 9 9 from pyzotero.zotero import chunks 10 10 11 11 ··· 15 15 16 16 17 17 @click.group() 18 + @click.version_option(version=__version__, prog_name="pyzotero") 18 19 @click.option( 19 20 "--locale", 20 21 default="en-US", ··· 210 211 211 212 # Output results 212 213 if output_json: 213 - click.echo(json.dumps(output_items, indent=2)) 214 + click.echo( 215 + json.dumps( 216 + {"count": len(output_items), "items": output_items}, indent=2 217 + ) 218 + ) 214 219 else: 215 220 click.echo(f"\nFound {len(results)} items:\n") 216 221 for idx, item_obj in enumerate(output_items, 1):
+1 -1
uv.lock
··· 784 784 785 785 [[package]] 786 786 name = "pyzotero" 787 - version = "1.7.1" 787 + version = "1.7.2" 788 788 source = { editable = "." } 789 789 dependencies = [ 790 790 { name = "bibtexparser" },