Name | zot2sioyek JSON |
Version |
0.4.1
JSON |
| download |
home_page | None |
Summary | Script with managing utils of zotero database fratures to sioyek PDF reader. |
upload_time | 2024-09-22 14:19:54 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 Eduardo Campos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
sioyek
zotero
pdf
reader
highlights
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Zotero to Sioyek Highlights Manager
---
**Python script to embed zotero highlights to [sioyek](https://github.com/ahrm/sioyek), and other utils.**
- 🐍 Python [sqlite3](https://docs.python.org/3/library/sqlite3.html) and [pyzotero](https://github.com/urschrei/pyzotero) Based Script
> [!WARNING] **Tested only in linux**
[![updatebadge]][update] [![pypibadge]][pypi] [![mitbadge]][license]
[![ruffbadge]][ruff] [![emailbadge]][email]
[update]: https://github.com/eduardotlc/zot2sioyek/commits/master/
[updatebadge]: https://img.shields.io/badge/Updated-August_2024-93ddfb?style=for-the-badge&logo=googlecalendar
[license]: https://opensource.org/licenses/mit
[pypi]: https://pypi.org/project/zot2sioyek/
[ruff]: https://github.com/astral-sh/ruff
[pypibadge]: https://img.shields.io/pypi/v/zot2sioyek.svg?logo=python&logoColor=yellow&color=7e7edd&style=for-the-badge
[email]: mailto:eduardotcampos@usp.br
[emailbadge]: https://img.shields.io/badge/Email-7e7edd?style=for-the-badge&logo=gmail
[mitbadge]: https://img.shields.io/badge/License-MIT-9aefea?style=for-the-badge&logo=gitbook
[ruffbadge]: https://img.shields.io/badge/Ruff-4a4a4a?style=for-the-badge&logo=ruff
## 📖 Contents
- ✨ [Features](#-features)
- 📚 [Requirements](#-requirements)
- 🐍 [Conda](#-conda)
- 📦 [Installation](#-installation)
- 🔧 [Configuration](#-configuration)
- 🎨 [Colors](#-colors)
- 💻 [Client](#-client)
- 📝 [TODO](#-todo)
- 🤝 [Contributing](#-contributing)
- 💓 [Aknowledgements](#-aknowledgements)
## ✨ Features
- Embed zotero highlights to the sioyek database:
```bash
python zot2sioyek.py --insert-highlights "/path/to/file.pdf"
```
- Print in terminal the text of all the highlights from a zotero file, colored with the highlight
color
```bash
python zot2sioyek.py --print-annotation-text "/path/to/file.pdf"
```
- To see all available commands:
```bash
python zot2sioyek.py --help
```
> [!NOTE]
> If installed through pip, you can run only `zot2sioyek` instead of `python zot2sioyek.py`.
- For testing the package through pytest
```bash
python -m pytest --doctest-modules tests/test.py src/zot2sioyek/zot2sioyek.py
```
## 📚 Requirements
Requirements are automatic installed when this script is installed with pip
- pyzotero
- pymupdf
- PyQt5
- regex
- sqlite3
```bash
python -m pip install pyzotero pymupdf PyQt5 regex sqlite3
```
### 🐍 Conda
If wanted, requirements may be installed with conda, to run this script in a conda environment.
Inside this repo, run:
```bash
conda env create --file env.yml
```
## 📦 Installation
To run the script without installation, simply clone the repo or download /src/zot2sioyek/zot2sioyek.py
and run it directly.
Default installation is done by
```bash
python -m pip install zot2sioyek
```
Being possible after install to run the comman with `zot2sioyek` in terminal.
Other possible approach to install is cloning the repo and installing locally
```bash
git clone https://github.com/eduardotlc/zot2sioyek
cd zot2sioyek
python -m pip install -e .
```
## 🔧 Configuration
To use this script define the variables in zot2sioyek.py:
- `SIOYEK_PATH`: Sioyek binary path.
- `SIOYEK_LOCAL_DATABASE_FILE_PATH`: Sioyek .db local database file path.
- `SIOYEK_SHARED_DATABASE_FILE_PATH`: Sioyek .db shared database file path.
- `ZOTERO_LIBRARY_ID`: Your personal library ID available [Here](https://www.zotero.org/settings/keys),
in the section Your userID for use in API calls.
- `ZOTERO_API_KEY`: Api key, you can obtain [Here](https://www.zotero.org/settings/keys/new).
- `ZOTERO_LIBRARY_TYPE`: Zotero library type, can be `'user'` or `'group'`.
- `ZOTERO_LOCAL_DIR`: Zotero local storage folder, like `/home/user/Zotero/storage`.
- `ZOTERO_TO_SIOYEK_COLORS`: Sioyek highlight type letter associated to each zotero highlight color
(Optional).
> [!NOTE]
> The variables can also be defined as envrinoment variables (at your .zshrc/.bashrc etc...), with
> the exact same names as the script variables above, and ZOTERO_TO_SIOYEK_COLORS if defined should
> be defined as a string like:
> export ZOTERO_TO_SIOYEK_COLORS='{ "#5fb236": "h", "#a28ae5": "i", "#e56eee": "i", "#2ea8e5": "d", "#ff6666": "e", "#f19837": "r", "#ffd400": "s"}'
### 🎨 Colors
- This script defines `ZOTERO_TO_SIOYEK_COLORS` variable based on the most close colors of default
sioyek config, to the zotero highlight colors. The conversion looks like the following (Zotero
colors in the upper row, sioyek colors in the lower row):
![comparison colors](/images/coparison_colors.png)
- If you want to have the exact same colors of zotero highlights in sioyek, add the following to
your sioyek `prefs_user.config`:
```
highlight_color_g 0.37 0.70 0.21
highlight_color_a 0.63 0.54 0.90
highlight_color_p 0.90 0.43 0.93
highlight_color_b 0.18 0.66 0.90
highlight_color_r 1.00 0.40 0.40
highlight_color_o 0.95 0.60 0.22
highlight_color_y 1.00 0.83 0.00
```
- Or to any highlight letter you want, since the defined letter on `prefs_user.config` and the script
variable `ZOTERO_TO_SIOYEK_COLORS` match.
## 💻 Client
**The following commands are available through:**
In a local folder after downloading the script, cd in `/src/zot2sioyek` and run
> python zot2sioyek.py [FLAG] [ARGS]
If installed through pip or through `cloning` or with `pip install -e .` in the repo root, the 2
following commands are available
> python -m zot2sioyek.zot2sioyek [FLAG] [ARGS]
> zot2sioyek [FLAG] [ARGS]
```bash
FLAGS ARGUMENTS
===== ==========
Script general utils.
----------------------
-h, --help
Print this script help.
If a Group name is passed after --help, the help to this specific group is printted
only. Available groups are: general, zotero, sioyek.
Zotero Managing Commands.
--------------------------
-g, --get-highlights [file_name_or_path]
Print all highlights from a given zotero file.
-p, --print-annotation-text [file_name_or_path]
print all highlighted text for a given zotero PDF local file.
-T, --zotero-tags [file_name_or_path]
Prints a zotero PDF attachment parent item existing arguments.
-A, --add-zotero-tag [file_name_or_path], [tag_str_to_add]
Add a tag to a zotero PDF attachment parent item. Takes arguments file name or
path, and tag str to add.
-R, --remove-zotero-tag [file_name_or_path], [tag_str_to_remove]
Remove a tag from a zotero PDF attachment parent item. Takes arguments file name or
path, and tag str to remove.
Sioyek Main Commands.
----------------------
-f, --list-sioyek-files
Print all files in sioyek local database
-H, --list-sioyek-hash [file_name_or_path]
print a sioyek database pdf file md5sum hash.
-l, --print-sioyek-attributes [file_name_or_path]
Print all Attributes and values in a sioyek database PDF file.
-i, --insert-highlight [file_name_or_path]
Insert highlights in a sioyek database PDF file, importing this highlights from this
PDF file zotero attachment highlight.
-d, --insert-dated-highlight [datetime.datetime]
Insert highlights in multiple sioyek database PDF files, importing this highlights from this
based on the passed arguments of a datetime.datetime date, to start from to search
for highlights, limit_number_items, that sets the maximum of items to retrieve, and
sort method that organize the order of the retrieved items.
-S, --list-all-sioyek-highlights
Print all sioyek highlights
-k, --citation_key [file_name_or_path]
Print zotero PDF file parent citation key.
Extra options flags.
---------------------
--sort [pyzotero_sort_strategy]
Pyzotero items sorting method. Requires to have passed --insert-dated-highlight.
If an argument passed after a flag contain blank spaces, remember to quote wrap it,
while not being necessary case inputted after through prompted option.
Author: eduardotcampos@usp.br
```
> [!NOTE]
> The --help flag, or not passing any flag, prints the above help.
> This help includes terminal colored lines and other formatters, if desired, the
> -h flag also print a help function, but in plain format.
### Zotero Commands
The here examples to the zotero group command flags, were runned considering a local PDF file,
that is also added to the zotero database, containing 3 differenct color highlights, that where
added through zotero app.
#### Get Highlights
<details>
<summary><code>-g --get-highlights</code></summary>
```bash
zot2sioyek -g "/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf"
```
```text
1
-----
Text: water-based conditions to maintain enzymatic activity due to the inherent fragility
Color: #f19837
Relative Page: 2
Doc Page: 2
Creation Date: 2024-09-08 05:56:08
Modification Date: 2024-09-08 05:56:08
2
-----
Text: Biocatalysts, including enzymes, which are functional proteins known for their outstanding catalytic efficiency, specificity, and selectivity, ha
ve been greatly studied for both research purposes and industrial applications
Color: #a28ae5
Relative Page: 2
Doc Page: 2
Creation Date: 2024-09-08 05:54:42
Modification Date: 2024-09-08 05:54:42
3
-----
Text: well-defined 3D structure of enzyme@ZIF-90 crystals during ultrafast milling reactions. We further demonstrated
Color: #5fb236
Relative Page: 2
Doc Page: 2
Creation Date: 2024-09-08 05:54:35
Modification Date: 2024-09-08 05:54:35
```
</details>
#### Print Annotation Text
<details>
<summary><code>-p --print-annotation-text</code></summary>
<code>
<p style="color:#f19837">water-based conditions to maintain enzymatic activity due to the inherent fragility</p>
<p style="color:#a28ae5">Biocatalysts, including enzymes, which are functional proteins known for their outstanding catalytic efficiency, specificity, and selectivity, have been greatly studied for both research purposes and industrial applications</p>
<p style="color:#5fb2e6">well-defined 3D structure of enzyme@ZIF-90 crystals during ultrafast milling reactions. We further demonstrate </p>
</code>
</details>
#### Zotero Tags
<details>
<summary><code>-T --zotero-tags</code></summary>
```bash
zot2sioyek -T "/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf"
```
```text
Biological, Catalysis, Encapsulating, MOF, Mechanochemistry, Synthesis, Unread, ⭐️⭐️
```
</details>
#### Add Zotero Tag
<details>
<summary><code>-A --add-zotero-tag</code></summary>
```bash
zot2sioyek -A "/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf" Testing
```
```text
Tag Testing added to PDF parent item.
```
</details>
#### Remove Zotero Tag
<details>
<summary><code>-R --remove-zotero-tag</code></summary>
```bash
zot2sioyek -R "/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf" Testing
```
```text
Tag Testing removed from item.
```
</details>
### Sioyek
#### List Sioyek Files
<details>
<summary><code>-f --list-sioyek-files</code></summary>
```bash
zot2sioyek -f
```
```text
f607f555da6ff4f2beb80653e9b07723 : /home/eduardotc/Zotero/storage/HN3SF8WA/Quiroz et al. - 2018 - Controlling Reaction Selectivity over Hybrid Plasmonic Nanocatalysts.pdf
304ca2c74cdfdc66e70098442fb5f75c : /home/eduardotc/Zotero/storage/L9PG5ZKI/Kolemen et al. - 2016 - Remote-Controlled Release of Singlet Oxygen by the.pdf
8b2479fdeaf3261f6de4804c4c2995bc : /home/eduardotc/Zotero/storage/R9RLP4UW/Supporting_MOF_anthracene_singlet.pdf
bfc2bac356c35a457f660a63e8d1ae77 : /home/eduardotc/Zotero/storage/9HAKQCTN/Vijayakumar - 2023 - Cancer targeted contrast studies and photothermal therapy using engineered gold nanoparticles.pdf
303185f111afbd8452b5194b58d00244 : /home/eduardotc/output.pdf
```
> [!WARNING]
> This Command prits all present files in your sioyek database, so be aware for the possibillity
> of being a realy long output.
</details>
#### List Sioyek Hash
<details>
<summary><code>-H --list-sioyek-hash</code><summary>
```bash
zot2sioyek -H "/home/eduardotc/Zotero/storage/HN3SF8WA/Quiroz et al. - 2018 - Controlling Reaction Selectivity over Hybrid Plasmonic Nanocatalysts.pdf"
```
```text
f607f555da6ff4f2beb80653e9b07723
```
> [!NOTE]
> In reality, this command only gets an already stored file hash value from the sioyek database,
> upon a file path matching. That being so, if the passed file has never being opened in sioyek,
> the hash won't be part of the database and won't be returned.
</details>
<!-- -TODO:Add sioyek flags -l and -i, after they have being optimized -->
<!-- -PERF: -->
## 📝 TODO
- Embed all zotero database highlights starting from a specified date.
- Create import from sioyek database to zotero database highlights.
- Currently, I couldn't find a way of adding zotero highlights through pyzotero, or through
zotero api/sql. If anyone knows how to do it, please message or email me so that I can update
this script, or feel free to implement the needed updates and send a pull request, I'll be
very thankful.
## 🤝 Contributing
Feel free to make [pending](#-todo) or other optimizations and pull requests, this script is
still under development and any contribution is very much appreciated.
- Clone the repo to your local environment:
## 💓 Aknowledgements
- [Ahrm](https://github.com/ahrm) for developing [Sioyek](https://github.com/ahrm/sioyek) PDF reader.
- [Urschrei](https://github.com/urschrei) for [Pyzotero](https://github.com/urschrei/pyzotero)
- [Blob42](https://github.com/blob42) for [Koreader-sioyek-import](https://github.com/blob42/koreader-sioyek-import),
which parts of this script was based from.
- The [Zotero](https://www.zotero.org/) team.
Raw data
{
"_id": null,
"home_page": null,
"name": "zot2sioyek",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "sioyek, zotero, PDF, reader, highlights",
"author": null,
"author_email": "Eduardo Toledo Campos <eduardotcampos@usp.br>",
"download_url": "https://files.pythonhosted.org/packages/17/f6/57326eec5193e041d3b1fcc0fbbb94962db06a44081860eebb473d340415/zot2sioyek-0.4.1.tar.gz",
"platform": null,
"description": "# Zotero to Sioyek Highlights Manager\n\n---\n\n**Python script to embed zotero highlights to [sioyek](https://github.com/ahrm/sioyek), and other utils.**\n\n- \ud83d\udc0d Python [sqlite3](https://docs.python.org/3/library/sqlite3.html) and [pyzotero](https://github.com/urschrei/pyzotero) Based Script\n \n> [!WARNING] **Tested only in linux**\n\n[![updatebadge]][update] [![pypibadge]][pypi] [![mitbadge]][license]\n\n[![ruffbadge]][ruff] [![emailbadge]][email]\n\n[update]: https://github.com/eduardotlc/zot2sioyek/commits/master/\n[updatebadge]: https://img.shields.io/badge/Updated-August_2024-93ddfb?style=for-the-badge&logo=googlecalendar\n[license]: https://opensource.org/licenses/mit\n[pypi]: https://pypi.org/project/zot2sioyek/\n[ruff]: https://github.com/astral-sh/ruff\n[pypibadge]: https://img.shields.io/pypi/v/zot2sioyek.svg?logo=python&logoColor=yellow&color=7e7edd&style=for-the-badge\n[email]: mailto:eduardotcampos@usp.br\n[emailbadge]: https://img.shields.io/badge/Email-7e7edd?style=for-the-badge&logo=gmail\n[mitbadge]: https://img.shields.io/badge/License-MIT-9aefea?style=for-the-badge&logo=gitbook\n[ruffbadge]: https://img.shields.io/badge/Ruff-4a4a4a?style=for-the-badge&logo=ruff\n\n## \ud83d\udcd6 Contents\n\n- \u2728 [Features](#-features)\n- \ud83d\udcda [Requirements](#-requirements)\n - \ud83d\udc0d [Conda](#-conda)\n- \ud83d\udce6 [Installation](#-installation)\n- \ud83d\udd27 [Configuration](#-configuration)\n - \ud83c\udfa8 [Colors](#-colors)\n- \ud83d\udcbb [Client](#-client)\n- \ud83d\udcdd [TODO](#-todo)\n- \ud83e\udd1d [Contributing](#-contributing)\n- \ud83d\udc93 [Aknowledgements](#-aknowledgements)\n\n## \u2728 Features\n\n- Embed zotero highlights to the sioyek database:\n\n```bash\npython zot2sioyek.py --insert-highlights \"/path/to/file.pdf\"\n```\n\n- Print in terminal the text of all the highlights from a zotero file, colored with the highlight\n color\n\n```bash\npython zot2sioyek.py --print-annotation-text \"/path/to/file.pdf\"\n```\n\n- To see all available commands:\n\n```bash\npython zot2sioyek.py --help\n```\n\n> [!NOTE]\n> If installed through pip, you can run only `zot2sioyek` instead of `python zot2sioyek.py`.\n\n- For testing the package through pytest\n\n```bash\npython -m pytest --doctest-modules tests/test.py src/zot2sioyek/zot2sioyek.py\n```\n\n## \ud83d\udcda Requirements\n\nRequirements are automatic installed when this script is installed with pip\n\n- pyzotero\n\n- pymupdf\n\n- PyQt5\n\n- regex\n\n- sqlite3\n\n```bash\npython -m pip install pyzotero pymupdf PyQt5 regex sqlite3\n```\n\n### \ud83d\udc0d Conda\n\nIf wanted, requirements may be installed with conda, to run this script in a conda environment.\n\nInside this repo, run:\n\n```bash\nconda env create --file env.yml\n```\n\n## \ud83d\udce6 Installation\n\nTo run the script without installation, simply clone the repo or download /src/zot2sioyek/zot2sioyek.py\nand run it directly.\n\nDefault installation is done by\n\n```bash\npython -m pip install zot2sioyek\n```\n\nBeing possible after install to run the comman with `zot2sioyek` in terminal.\n\nOther possible approach to install is cloning the repo and installing locally\n\n```bash\ngit clone https://github.com/eduardotlc/zot2sioyek\ncd zot2sioyek\npython -m pip install -e .\n```\n\n## \ud83d\udd27 Configuration\n\nTo use this script define the variables in zot2sioyek.py:\n\n- `SIOYEK_PATH`: Sioyek binary path.\n\n- `SIOYEK_LOCAL_DATABASE_FILE_PATH`: Sioyek .db local database file path.\n\n- `SIOYEK_SHARED_DATABASE_FILE_PATH`: Sioyek .db shared database file path.\n\n- `ZOTERO_LIBRARY_ID`: Your personal library ID available [Here](https://www.zotero.org/settings/keys),\n in the section Your userID for use in API calls.\n\n- `ZOTERO_API_KEY`: Api key, you can obtain [Here](https://www.zotero.org/settings/keys/new).\n\n- `ZOTERO_LIBRARY_TYPE`: Zotero library type, can be `'user'` or `'group'`.\n\n- `ZOTERO_LOCAL_DIR`: Zotero local storage folder, like `/home/user/Zotero/storage`.\n\n- `ZOTERO_TO_SIOYEK_COLORS`: Sioyek highlight type letter associated to each zotero highlight color\n (Optional).\n\n> [!NOTE]\n> The variables can also be defined as envrinoment variables (at your .zshrc/.bashrc etc...), with\n> the exact same names as the script variables above, and ZOTERO_TO_SIOYEK_COLORS if defined should\n> be defined as a string like:\n> export ZOTERO_TO_SIOYEK_COLORS='{ \"#5fb236\": \"h\", \"#a28ae5\": \"i\", \"#e56eee\": \"i\", \"#2ea8e5\": \"d\", \"#ff6666\": \"e\", \"#f19837\": \"r\", \"#ffd400\": \"s\"}'\n\n### \ud83c\udfa8 Colors\n\n- This script defines `ZOTERO_TO_SIOYEK_COLORS` variable based on the most close colors of default\n sioyek config, to the zotero highlight colors. The conversion looks like the following (Zotero\n colors in the upper row, sioyek colors in the lower row):\n\n![comparison colors](/images/coparison_colors.png)\n\n- If you want to have the exact same colors of zotero highlights in sioyek, add the following to\n your sioyek `prefs_user.config`:\n\n```\nhighlight_color_g 0.37 0.70 0.21\nhighlight_color_a 0.63 0.54 0.90\nhighlight_color_p 0.90 0.43 0.93\nhighlight_color_b 0.18 0.66 0.90\nhighlight_color_r 1.00 0.40 0.40\nhighlight_color_o 0.95 0.60 0.22\nhighlight_color_y 1.00 0.83 0.00\n```\n\n- Or to any highlight letter you want, since the defined letter on `prefs_user.config` and the script\n variable `ZOTERO_TO_SIOYEK_COLORS` match.\n\n## \ud83d\udcbb Client\n\n**The following commands are available through:**\n\nIn a local folder after downloading the script, cd in `/src/zot2sioyek` and run\n\n> python zot2sioyek.py [FLAG] [ARGS]\n\nIf installed through pip or through `cloning` or with `pip install -e .` in the repo root, the 2\nfollowing commands are available\n\n> python -m zot2sioyek.zot2sioyek [FLAG] [ARGS]\n\n> zot2sioyek [FLAG] [ARGS]\n\n```bash\nFLAGS ARGUMENTS\n===== ==========\n\n\nScript general utils.\n----------------------\n\n-h, --help \nPrint this script help.\nIf a Group name is passed after --help, the help to this specific group is printted\nonly. Available groups are: general, zotero, sioyek. \n\nZotero Managing Commands.\n--------------------------\n\n-g, --get-highlights [file_name_or_path]\nPrint all highlights from a given zotero file.\n-p, --print-annotation-text [file_name_or_path]\nprint all highlighted text for a given zotero PDF local file.\n-T, --zotero-tags [file_name_or_path]\nPrints a zotero PDF attachment parent item existing arguments.\n-A, --add-zotero-tag [file_name_or_path], [tag_str_to_add]\nAdd a tag to a zotero PDF attachment parent item. Takes arguments file name or\npath, and tag str to add. \n-R, --remove-zotero-tag [file_name_or_path], [tag_str_to_remove]\nRemove a tag from a zotero PDF attachment parent item. Takes arguments file name or\npath, and tag str to remove. \n\nSioyek Main Commands.\n----------------------\n\n-f, --list-sioyek-files \nPrint all files in sioyek local database\n-H, --list-sioyek-hash [file_name_or_path]\nprint a sioyek database pdf file md5sum hash.\n-l, --print-sioyek-attributes [file_name_or_path]\nPrint all Attributes and values in a sioyek database PDF file.\n-i, --insert-highlight [file_name_or_path]\nInsert highlights in a sioyek database PDF file, importing this highlights from this\nPDF file zotero attachment highlight. \n-d, --insert-dated-highlight [datetime.datetime]\nInsert highlights in multiple sioyek database PDF files, importing this highlights from this\nbased on the passed arguments of a datetime.datetime date, to start from to search\nfor highlights, limit_number_items, that sets the maximum of items to retrieve, and\nsort method that organize the order of the retrieved items. \n-S, --list-all-sioyek-highlights \nPrint all sioyek highlights\n-k, --citation_key [file_name_or_path]\nPrint zotero PDF file parent citation key.\n\nExtra options flags.\n---------------------\n\n--sort [pyzotero_sort_strategy]\nPyzotero items sorting method. Requires to have passed --insert-dated-highlight.\n\nIf an argument passed after a flag contain blank spaces, remember to quote wrap it,\nwhile not being necessary case inputted after through prompted option.\n\nAuthor: eduardotcampos@usp.br\n```\n\n> [!NOTE]\n> The --help flag, or not passing any flag, prints the above help. \n> This help includes terminal colored lines and other formatters, if desired, the\n> -h flag also print a help function, but in plain format.\n\n### Zotero Commands\n\nThe here examples to the zotero group command flags, were runned considering a local PDF file,\nthat is also added to the zotero database, containing 3 differenct color highlights, that where\nadded through zotero app.\n\n#### Get Highlights\n\n<details>\n<summary><code>-g --get-highlights</code></summary>\n\n```bash\nzot2sioyek -g \"/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf\"\n```\n\n```text\n\n1\n-----\nText: water-based conditions to maintain enzymatic activity due to the inherent fragility\nColor: #f19837\nRelative Page: 2\nDoc Page: 2\nCreation Date: 2024-09-08 05:56:08\nModification Date: 2024-09-08 05:56:08\n\n2\n-----\nText: Biocatalysts, including enzymes, which are functional proteins known for their outstanding catalytic efficiency, specificity, and selectivity, ha\nve been greatly studied for both research purposes and industrial applications\nColor: #a28ae5\nRelative Page: 2\nDoc Page: 2\nCreation Date: 2024-09-08 05:54:42\nModification Date: 2024-09-08 05:54:42\n\n3\n-----\nText: well-defined 3D structure of enzyme@ZIF-90 crystals during ultrafast milling reactions. We further demonstrated\nColor: #5fb236\nRelative Page: 2\nDoc Page: 2\nCreation Date: 2024-09-08 05:54:35\nModification Date: 2024-09-08 05:54:35\n```\n</details>\n\n#### Print Annotation Text\n\n<details>\n<summary><code>-p --print-annotation-text</code></summary>\n\n<code>\n<p style=\"color:#f19837\">water-based conditions to maintain enzymatic activity due to the inherent fragility</p>\n<p style=\"color:#a28ae5\">Biocatalysts, including enzymes, which are functional proteins known for their outstanding catalytic efficiency, specificity, and selectivity, have been greatly studied for both research purposes and industrial applications</p>\n<p style=\"color:#5fb2e6\">well-defined 3D structure of enzyme@ZIF-90 crystals during ultrafast milling reactions. We further demonstrate </p>\n</code>\n\n</details>\n\n#### Zotero Tags\n\n<details>\n<summary><code>-T --zotero-tags</code></summary>\n\n```bash\nzot2sioyek -T \"/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf\"\n```\n\n```text\nBiological, Catalysis, Encapsulating, MOF, Mechanochemistry, Synthesis, Unread, \u2b50\ufe0f\u2b50\ufe0f\n```\n\n</details>\n\n#### Add Zotero Tag\n\n<details>\n<summary><code>-A --add-zotero-tag</code></summary>\n\n```bash\nzot2sioyek -A \"/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf\" Testing\n```\n\n```text\nTag Testing added to PDF parent item.\n```\n\n</details>\n\n#### Remove Zotero Tag\n\n<details>\n<summary><code>-R --remove-zotero-tag</code></summary>\n\n```bash\nzot2sioyek -R \"/home/eduardotc/Zotero/storage/E5M6X2IH/green ultrafast one-pot mechanochemical bio catalyst encapsulation in MO.pdf\" Testing\n```\n\n```text\nTag Testing removed from item.\n```\n\n</details>\n\n### Sioyek\n\n#### List Sioyek Files\n\n<details>\n<summary><code>-f --list-sioyek-files</code></summary>\n\n```bash\nzot2sioyek -f\n```\n\n```text\nf607f555da6ff4f2beb80653e9b07723 : /home/eduardotc/Zotero/storage/HN3SF8WA/Quiroz et al. - 2018 - Controlling Reaction Selectivity over Hybrid Plasmonic Nanocatalysts.pdf\n304ca2c74cdfdc66e70098442fb5f75c : /home/eduardotc/Zotero/storage/L9PG5ZKI/Kolemen et al. - 2016 - Remote-Controlled Release of Singlet Oxygen by the.pdf\n8b2479fdeaf3261f6de4804c4c2995bc : /home/eduardotc/Zotero/storage/R9RLP4UW/Supporting_MOF_anthracene_singlet.pdf\nbfc2bac356c35a457f660a63e8d1ae77 : /home/eduardotc/Zotero/storage/9HAKQCTN/Vijayakumar - 2023 - Cancer targeted contrast studies and photothermal therapy using engineered gold nanoparticles.pdf\n303185f111afbd8452b5194b58d00244 : /home/eduardotc/output.pdf\n```\n\n> [!WARNING]\n> This Command prits all present files in your sioyek database, so be aware for the possibillity\n> of being a realy long output.\n\n</details>\n\n#### List Sioyek Hash\n\n<details>\n<summary><code>-H --list-sioyek-hash</code><summary>\n\n```bash\nzot2sioyek -H \"/home/eduardotc/Zotero/storage/HN3SF8WA/Quiroz et al. - 2018 - Controlling Reaction Selectivity over Hybrid Plasmonic Nanocatalysts.pdf\"\n```\n\n```text\nf607f555da6ff4f2beb80653e9b07723 \n```\n\n> [!NOTE]\n> In reality, this command only gets an already stored file hash value from the sioyek database,\n> upon a file path matching. That being so, if the passed file has never being opened in sioyek,\n> the hash won't be part of the database and won't be returned.\n\n</details>\n\n<!-- -TODO:Add sioyek flags -l and -i, after they have being optimized -->\n \n<!-- -PERF: -->\n\n## \ud83d\udcdd TODO\n\n- Embed all zotero database highlights starting from a specified date.\n\n- Create import from sioyek database to zotero database highlights.\n\n - Currently, I couldn't find a way of adding zotero highlights through pyzotero, or through\n zotero api/sql. If anyone knows how to do it, please message or email me so that I can update\n this script, or feel free to implement the needed updates and send a pull request, I'll be\n very thankful.\n\n\n## \ud83e\udd1d Contributing\n\nFeel free to make [pending](#-todo) or other optimizations and pull requests, this script is\nstill under development and any contribution is very much appreciated.\n\n- Clone the repo to your local environment:\n\n## \ud83d\udc93 Aknowledgements\n\n- [Ahrm](https://github.com/ahrm) for developing [Sioyek](https://github.com/ahrm/sioyek) PDF reader.\n\n- [Urschrei](https://github.com/urschrei) for [Pyzotero](https://github.com/urschrei/pyzotero)\n\n- [Blob42](https://github.com/blob42) for [Koreader-sioyek-import](https://github.com/blob42/koreader-sioyek-import),\n which parts of this script was based from.\n\n- The [Zotero](https://www.zotero.org/) team.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Eduardo Campos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Script with managing utils of zotero database fratures to sioyek PDF reader.",
"version": "0.4.1",
"project_urls": {
"Bug Reports": "https://github.com/eduardotlc/zot2sioyek/issues",
"Homepage": "https://github.com/eduardotlc/zot2sioyek",
"Source": "https://github.com/eduardotlc/zot2sioyek/"
},
"split_keywords": [
"sioyek",
" zotero",
" pdf",
" reader",
" highlights"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "72ea9a3036223bf9dd6dd80978e23aeac98b2add2baf9cc9a8a8853417f2d1d9",
"md5": "bff670b7f2bfddeed79f94f940fc1afe",
"sha256": "c6fa0b07c1ddf0ac922e706a2a680254846a7cc0405ccb7a5470c695a1901f95"
},
"downloads": -1,
"filename": "zot2sioyek-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bff670b7f2bfddeed79f94f940fc1afe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 28530,
"upload_time": "2024-09-22T14:19:50",
"upload_time_iso_8601": "2024-09-22T14:19:50.692382Z",
"url": "https://files.pythonhosted.org/packages/72/ea/9a3036223bf9dd6dd80978e23aeac98b2add2baf9cc9a8a8853417f2d1d9/zot2sioyek-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17f657326eec5193e041d3b1fcc0fbbb94962db06a44081860eebb473d340415",
"md5": "14500df89b32e5d9070a18ec7668f226",
"sha256": "04bc5a8fd732c04688321f76b7f5b706f4dad060d3dcf56797779cbeb241ba99"
},
"downloads": -1,
"filename": "zot2sioyek-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "14500df89b32e5d9070a18ec7668f226",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2271329,
"upload_time": "2024-09-22T14:19:54",
"upload_time_iso_8601": "2024-09-22T14:19:54.466749Z",
"url": "https://files.pythonhosted.org/packages/17/f6/57326eec5193e041d3b1fcc0fbbb94962db06a44081860eebb473d340415/zot2sioyek-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-22 14:19:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "eduardotlc",
"github_project": "zot2sioyek",
"github_not_found": true,
"lcname": "zot2sioyek"
}