Giter VIP home page Giter VIP logo

notionflash's Introduction

NotionFlash

This is an Anki add on in development that will allow automatically convert your Notion study notes into Anki flash cards. The Anki deck created will remain synchronised with your notes, removing the need to rehash them into flash cards.

Motivation

NotionFlash was created as an integration between the wonderful document management platform Notion and the excellent open-source flash card utility Anki. The goal is to automate the creation of Anki flash cards derived from selected pages in a Notion workspace.

Installation

You can run this project just like any python script but at this stage in development it does require quite abit of initial setup.

Environment

To run this script requires abit of setup. Download the folder AnkiBots and within it create a .env file with the following variables

NOTION_SECRET=...
DECK=...
PAGE_ONE=...
PAGE_TWO=...
PAGE_THREE=...

The value for NOTION_SECRET is your Notion authentication token. You can find information about this here Notion API Authorisation and how to setup an API endpoint and share your Notion pages to it.

The value for DECK is the name of the ANKI deck you wish to add cards to.

The values for PAGE_ONE, PAGE_TWO, PAGE_THREE, PAGE_XXX and so on are Notion page id's. You can find out about page id's here Notion API Getting Started. You must format your page id as is in the following example

...
PAGE_ONE=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
...

You must then update line 26 in the main file with the page names you have specified in the .env as well as a tag for each respective page. For example

...
DATABASES = [{"Database":os.getenv("PAGE_ONE"), "cardTag": "PageOneTag"}, {"Database":os.getenv("PAGE_TWO"), "cardTag": "PageTwoTag"}, {"Database":os.getenv("PAGE_THREE"), "cardTag": "PageThreeTag"}]
...

AnkiConnect

You must install the Anki add on AnkiConnect and have Anki open when you run the script

How it works

This script leverages the Notion beta API and Notion toggle lists to create simple Question and Answer Anki cards. In order for the script to identify notes that you wish to convert into a card simply create a toggle (/toggle) in your Notion page with the Question as the title and the Answer as the nested content.

The script will run through all the toggle lists on your page and add them to your specified Anki deck. Cards are not duplicated the following formats are supported - numbered lists, bullet points, images.

Contributing

This project is in its infancy any and all ideas are welcome!

Licence

License: MIT

Licensed under the MIT Licence

notionflash's People

Contributors

neerajhp avatar

Stargazers

 avatar

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.