Giter Club home page Giter Club logo

zoterotonotion's Introduction

Zotero To Notion

ZoteroToNotion

Description

This project allows you to export newly added or recently updated documents in Zotero (local database, synced via Google Drive) to your Notion database via the Notion APIs and by reading the zotero.sqlite database LOCALLY. If you'd like the export to happen as soon as you make a change in Zotero, then you can run the script scripts/runZoteroToNotion.sh peridocially at a reasonable frequency via a crontab job.

Directory Structure

.
+-- docs/
|   +-- images/
|   |   +-- demo.png
|   |   +-- icon.png
+-- globalStore/
|   +-- constants.py
+-- lib/
|   +-- port_utils.py
|   +-- utils.py
+-- notebooks/
|   +-- Trial_ZoteroDatabase.py
+-- scripts/
|   +-- runZoteroToNotion.sh
+-- secrets/
|   +-- secrets_notion.json
|   +-- secrets_zotero.json
+-- src/
|   +-- zoteroToNotion.py
+-- tests/
|   +-- testNotionAPI.py
|   +-- testZoteroRead.py
+-- .gitignore
+-- juyptext.toml
+-- LICENSE
+-- README.md
+-- requirements.txt
+-- STDOUTlog_examples.txt

ZoteroToNotionScreenshot

Usage

  1. Create a python conda env using requirements.txt
  2. Ensure that the plugins BetterBib and Zotfile are installed. If you want to run this on an automated schedule on server using Crontab, one option is to ensure your local Zotero database is synced to an accessible path via Google Drive and use it as a READ_ONLY_DIRECTORY.
  3. Register a private integration on your Notion workspace (follow instructions online)
  4. Obtain its notionToken
  5. Create a database on Notion to contain all the entries from Zotero. Make sure it has the following properties. If you want to add more properties or remove, modify the function getDataFromZoteroDatabases and getNotionPageEntryFromPropObj in lib/port_utils.py.
Title property: Citation
Text properties: Title, UID, Authors, Venue, Year, Abstract, Type, BibTex, Filename, Collection Names, Zotero Tags
Url properties: URL
Date properties: Created At, Last Modified At
  1. Get its databaseID and add it to secrets/secrets_notion.json in the following format:
{
    "notionToken": "your notion token",
    "databaseID": "your notion database ID"
}
  1. Run the python script src/zoteroToNotion.py with --copyZotero argument as True (default)
  2. Currently, the logic reads all items from the Zotero database and all items in the Notion database. For each item in Zotero, we check if it already exists in Notion. If yes, we check if the last modified time on Zotero is AFTER the last edited time in Notion. If yes, we update the Notion entry. If not, there's nothing to update. If the Zotero item doesn't exist in Notion, we create a brand new row in Notion.
  3. You can periodically run this file again as a script scripts/runZoteroToNotion.sh using a crontab job to get periodic updates. For more information on Crontab, check out this reference.

Requirements

You can install all the requirements using the following command:

pip install -r requirements.txt
pip install -e .

Sources

If you use it in your work and want to adapt this code, please consider starring this repo or forking from it!

@misc{nanbhas2022_zoteroToNotion,
  title={Zotero To Notion},
  author={Nandita Bhaskhar},
  howpublished={GitHub Repo, https://github.com/nanbhas/ZoteroToNotion},
  year={2022}
}

zoterotonotion's People

Stargazers

 avatar

Watchers

 avatar

zoterotonotion's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.