Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sizmailov/zotero-notion-sync
Sync Zotero library with Notion database
https://github.com/sizmailov/zotero-notion-sync
notion notion-database synchronization zotero zotero-sync
Last synced: about 1 month ago
JSON representation
Sync Zotero library with Notion database
- Host: GitHub
- URL: https://github.com/sizmailov/zotero-notion-sync
- Owner: sizmailov
- Created: 2022-02-24T00:05:01.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T15:21:21.000Z (over 2 years ago)
- Last Synced: 2024-10-30T08:37:10.312Z (3 months ago)
- Topics: notion, notion-database, synchronization, zotero, zotero-sync
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zotero ↔ Notion
Synchronize Zotero with Notion via public APIs.
Here is the assumed workflow:
1. Add a paper to Zotero
2. Wait for synchronization
3. Go to corresponding Notion page and annotate paperAt synchronization `sync-zotero-notion`:
- Creates new items in Notion database
- Creates Zotero note with link to corresponding Notion page
- Updates Zotero fields in Notion database👨🎓📗 Notion fields — Columns in Notion database that SHOULD BE edited manually.
🤖📕 Zotero fields — Columns in Notion database that MUST NOT be edited by users. Those columns are continuously overwritten with values from Zotero.
## How to
### Setup
#### Notion
1. Create Notion database with `Title`, `Authors`, `Link`, `Published at`, `Zotero 🖥️`, `Zotero 🌐`, `Zotero ItemID` fields.
2. Create [integration token](https://www.notion.so/my-integrations/) with read/write permissions
3. Share database with integration (from top-right conner of database page):
![Share database with integration](images/share-with-integration.png)
#### Zotero
1. Create [new group](https://www.zotero.org/groups/new)
2. Create [API token](https://www.zotero.org/settings/keys) with read/write permissions### Sync
1. Create `config.yml` and fill with values obtained earlier
```yaml
notion:
token: "<...>"
database_id: "<...>"zotero:
token: "<...>"
group_id: 123456789```
2. Install `zotero-notion-sync`
```bash
pip install git+https://github.com/sizmailov/zotero-notion-sync.git
```3. Synchronize
```bash
sync-zotero-notion --config=./config.yml
```## Development
### Set up environment and install dependencies
```bash
python3.9 -m venv venv
source venv/bin/activate
pip install -U pip wheel setuptools
pip install pip-tools
pip-sync requirements-dev.txt
pre-commit install
```### Run linters
```bash
# Pre-commit hooks
pre-commit run --all-files
```### Integration with systemd
1. Create two files `sync-zotero-notion.*` in `/etc/systemd/system/` using template below.
2. Activate sync via```bash
sudo systemctl start sync-zotero-notion.timer
sudo systemctl enable sync-zotero-notion.timer
```
sync-zotero-notion.service
```
# TODO: replace `` with actual user name
[Unit]
Description=Sync Notion with Zotero
After=network.target network-online.target[Service]
User=
Group=
Type=simple
ExecStart=/home//venv/bin/sync-zotero-notion --config=/home//config.yml
```
sync-zotero-notion.timer
```
[Unit]
Description=Sync Notion with Zotero[Timer]
OnUnitInactiveSec=1m
OnBootSec=2m[Install]
WantedBy=timers.target
```