{"id":31710460,"url":"https://github.com/titaniumbones/zotero-cli","last_synced_at":"2025-10-09T00:27:41.872Z","repository":{"id":306592427,"uuid":"1021613034","full_name":"titaniumbones/zotero-cli","owner":"titaniumbones","description":"Proof of concept python \u0026 elisp library for working with zotero local api, especially for extraction PDF annotations. ","archived":false,"fork":false,"pushed_at":"2025-07-17T17:02:07.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T01:57:04.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/titaniumbones.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-17T17:01:59.000Z","updated_at":"2025-07-17T23:38:46.000Z","dependencies_parsed_at":"2025-07-26T17:50:15.856Z","dependency_job_id":"ce3281db-1060-4138-9273-003ba5e55466","html_url":"https://github.com/titaniumbones/zotero-cli","commit_stats":null,"previous_names":["titaniumbones/zotero-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/titaniumbones/zotero-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titaniumbones%2Fzotero-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titaniumbones%2Fzotero-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titaniumbones%2Fzotero-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titaniumbones%2Fzotero-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/titaniumbones","download_url":"https://codeload.github.com/titaniumbones/zotero-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/titaniumbones%2Fzotero-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000720,"owners_count":26082879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T00:27:40.772Z","updated_at":"2025-10-09T00:27:41.864Z","avatar_url":"https://github.com/titaniumbones.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zotero CLI\n\nA multi-language toolkit for retrieving and processing Zotero annotations via the local API. Provides both Python and Emacs Lisp implementations with API parity wherever possible.\n\n## 🚀 Quick Start\n\n### Python\n```bash\ncd python/\npip install requests\npython get-annots.py ITEM_ID --org  # Get annotations in org-mode format\npython org_zotero_client.py process notes.org  # Process org file citations\n```\n\n### Emacs Lisp\n```elisp\n(use-package org-zotero-client\n  :load-path \"/path/to/zotero-cli/elisp/\"\n  :ensure nil\n  :after org)\n\n(load-file \"/path/to/zotero-cli/elisp/org-zotero-client.el\")\n(org-zotero-extract-all-annotations-to-notes)\n```\n\n## 📁 Project Structure\n\n```\nzotero-cli/\n├── python/                    # Python implementation\n│   ├── get-annots.py         # Main annotation retrieval\n│   ├── org_zotero_client.py  # Org-mode file processing\n│   ├── list-libraries.py     # Library exploration\n│   └── README.md\n├── elisp/                     # Emacs Lisp implementation\n│   ├── zotero-api.el         # Core API client\n│   ├── org-zotero-client.el  # Org-mode integration\n│   ├── test/                 # Unit tests\n│   └── README.md\n└── test/                      # Test files and examples\n```\n\n## ✨ Core API Features\n\nBoth implementations provide identical functionality for:\n\n- **Library Management**: List libraries, get library info, work with group libraries\n- **Item Retrieval**: Get items, fetch individual items, retrieve child attachments\n- **Annotation Processing**: Extract annotations from PDFs, format as org-mode text\n- **Citation Resolution**: Map BibTeX keys to Zotero item IDs\n- **Batch Processing**: Process multiple citations in org-mode files\n\n### Key API Methods\n\n| Function | Python | Emacs Lisp |\n|----------|---------|------------|\n| List libraries | `get_libraries()` | `zotero-get-libraries` |\n| Get item | `get_item(item_id)` | `zotero-get-item` |\n| Get annotations | `get_all_annotations_for_item()` | `zotero-get-all-annotations-for-item` |\n| Format as org | `format_as_org_mode()` | `zotero-format-as-org-mode` |\n| Process citations | `process_org_file()` | `org-zotero-extract-all-annotations-to-notes` |\n\n## 🔧 Installation\n\n### Python\n```bash\ncd python/\npip install requests  # Only dependency\n```\n\n### Emacs Lisp\n\n**Using use-package (recommended):**\n```elisp\n(use-package request :ensure t)\n\n(use-package org-zotero-client\n  :load-path \"/path/to/zotero-cli/elisp/\"\n  :ensure nil\n  :after org\n  :bind ((\"C-c z a\" . org-zotero-extract-all-annotations-to-notes)\n         (\"C-c z l\" . org-zotero-list-libraries)\n         (\"C-c z s\" . org-zotero-set-library-for-buffer)))\n```\n\n**Manual installation:**\n```elisp\n(package-install 'request)  ; Install request package\n(add-to-list 'load-path \"/path/to/zotero-cli/elisp/\")\n(require 'org-zotero-client)\n```\n\n## 📖 Usage Examples\n\n### Python Examples\n\n```bash\n# Get annotations for a specific item\npython get-annots.py YW7IQA55\n\n# Get annotations in org-mode format\npython get-annots.py YW7IQA55 --org\n\n# Process org file and insert annotations for all citations\npython org_zotero_client.py process research-notes.org\n\n# Set library ID for an org file\npython org_zotero_client.py set-library research-notes.org\n\n# List all libraries\npython list-libraries.py\n```\n\n### Emacs Lisp Examples\n\n```elisp\n;; Interactive usage\nM-x org-zotero-extract-all-annotations-to-notes  ; Process all citations in buffer\nM-x org-zotero-list-libraries                    ; List available libraries\nM-x org-zotero-set-library-for-buffer           ; Set library ID for current buffer\n\n;; Programmatic usage\n(org-zotero-extract-all-annotations-to-notes \"/path/to/output.org\")\n(org-zotero-find-citations-in-buffer)\n(org-zotero-resolve-citation-key \"smith2023\")\n```\n\n### Org-Mode Citation Formats\n\nBoth implementations support multiple citation formats:\n\n```org\n# Simple citations\nThis paper @cowanMoreWorkMother1983 discusses important findings.\n\n# Org-cite format\nSee [cite:@smith2023] for methodology details.\n\n# BibTeX integration\n#+BIBLIOGRAPHY: references.bib\n#+ZOTERO_LIBRARY_ID: 5895731\n\nCitations like @author2023 are automatically resolved.\n```\n\n### Working with Group Libraries\n\nSet a library ID for your org file to work with group libraries:\n\n```org\n#+ZOTERO_LIBRARY_ID: 123456\n#+BIBLIOGRAPHY: references.bib\n\nYour content with citations @author2023 here.\n```\n\n## 🔗 Requirements\n\n- **Zotero Desktop**: Must be running with local API enabled\n- **Local API**: Accessible at `http://localhost:23119`\n- **Python**: 3.6+ with `requests` library\n- **Emacs**: 25.1+ with `request` package\n\n## 🛠️ Development\n\nThe project maintains API parity between Python and Emacs Lisp implementations wherever possible. Both provide equivalent functionality for:\n\n- Library and item management\n- Annotation extraction and formatting\n- Citation resolution and processing\n- Org-mode integration\n\n### Key Components\n\n- **Python**: `ZoteroLocalAPI` class provides core API functionality\n- **Emacs Lisp**: Functions in `zotero-api.el` provide equivalent API methods\n- **Org Integration**: Both support BibTeX citation resolution and org-mode formatting\n\n## 📚 Documentation\n\n- [Python Implementation README](python/README.md) - Detailed Python usage and API\n- [Emacs Lisp Implementation README](elisp/README.md) - Emacs commands and configuration\n- [API Reference](doc_resources/zotero_local_api_reference.md) - Complete API documentation\n\n## 🎯 Use Cases\n\n- **Research Writing**: Automatically insert Zotero annotations into org-mode documents\n- **Literature Review**: Batch process multiple papers and collect all annotations\n- **Note Organization**: Export annotations from Zotero into structured org-mode files\n- **Cross-Reference**: Link between Zotero items and your own notes\n- **Group Collaboration**: Work with shared Zotero group libraries\n\n## 🤝 Contributing\n\nThis project emphasizes maintaining API parity between implementations. When adding features, ensure both Python and Emacs Lisp versions are updated consistently.\n\n## 📄 License\n\nThis project is provided as-is for research and educational purposes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitaniumbones%2Fzotero-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftitaniumbones%2Fzotero-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftitaniumbones%2Fzotero-cli/lists"}