Skip to content

elashrry/notion2memrise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

!!OBSOLETE!! Memrise decided to remove all community courses from the main website and app to a different website and to shut that website by the end of 2024, so it's not worth the effort to put in this project, and I decided to migrate everything to Anki, and probably to add the words on it directly instead of having Notion in the middle.

About

I am using Notion to create a database of words I want to learn in a foreign language, and I am using Memrise to learn them through their scientific time-spaced memorization algorithm. This project is a way to automate the process of creating a course on Memrise from a database on Notion.

Why not just use Memrise directly?
Notion is easier to use and had more features. For example, I can add much more notes to a single word on Notion including embedding videos to how to use it, for example.

How to use

  1. On Notion: Create a database. It must contain at least three columns: one for the language you want to learn, one for the language you already know, say, French and English, and one for the last modified data named date modified.
  2. On Memrise:
    a. Create a course (follow these instructions).
    b. Convert the course into complex mode by simply adding another level to the course, so you have two empty levels.
    c. (optional if you want to add more columns to the course) Go to the database tab of the course, and click on the automatically created one, and add more columns.
    d. save changes (in the levels tab).

  1. Clone this repository
  2. Follow the requirements section below
  3. Change the constants in src/constants.
  4. Run notion2memrise.py from the root directory.

How does it work

Notion

The database on Notion would look like:

Notion database

We use their API to query the database. An extra piece of information we get from the API is a unique ID for each cell/page in the database. We will use this ID to link words in the notion database to words on the memrise course.

TODO:

  • get the database via API
  • create a pandas dataframe from the database
  • clean the dataframe
  • handle duplicates in the notion database

Memrise

Memrise does not offer an API, so I went to the old goody Selenium to control the course. Therefore, this solution won't scale well, but it does the job for me.

TODO:

Do I work with the levels page or the database page

  • get all words from memrise.
  • handle words deleted from the notion database
  • handle words that already exist but have been modified
  • add words to the course

Requirements

  • create a Notion integration in your workspace. Follow these instructions.
  • Python libraries are defined in environment.yaml.
  • You will need to define your own variable: NOTION_SECRET, MEMRISE_EMAIL, MEMRISE_PASSWORD in in the environment.yaml file.
  • You can create a conda environment with
conda env create -f environment.yaml

and activate it with

conda activate notion2memrise
  • You will also need a driver for Selenium (e.g. geckodriver for Firefox or ChromeDriver for Chrome ). I am using FireFox in this project.

Testing

I added tests for the function that governs most of the script, but I want to add more unit tests, but in the meantime, I would rather spend my time learning French :) ... but I will come back to it.

Limitations

  • Many will come as I use the code more and more.

improvements

  • Add more verbose logging when running the program.
  • Divide memrise.py into separate files (and maybe build them as objects).
  • Get pronunciation of words from WordReference to Memrise.
  • Function to create the course on Memrise in complex mode.
  • Is it possible to convert these scripts to a Notion integration?
  • change update_words and _update_cell to use row id and column id and type instead of complex relative xpaths.
  • reorganise the constants in the code.
  • complete testing modules for everything.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages