This reporitory can be used to sync the change between leetcode and notion for better measuring the leetcode practice quality. There are two components to use this tool:
- Leetcode practice notion template which the instruction from interview science.
- The synchroization script, which is necessarily the repo you are checking. By running this script, you can automatically synchroize your recent submission to a notion tracking board which can reflect.
Preview website: site
Create the page by duplicate this template.
Use the following command to create a miniconda environment.
conda env create -f environment.yml
Please fill out the following part in constants.py
# Get the next two values from your browser cookies
LEETCODE_SESSION = "your leetcode session"
CSRF_TOKEN = "your csrf token"
NOTION_TOKEN = "your notion token"
DATABASE_ID = "database id"
- Leetcode session and CSRF token can be found in network request after you sign into leetcode.
- Notion token could be created in my-integration
- Database ID could be found by following this instruction.
By running the following command, your recent submission will be used to update the notion database.
Generally I would recommend set up a Cron job on your laptop. And run the following command.
python main.py --update_with_submission --n 100
By adding the following section to your submission, more detailed will reflect on your page.
'''
[
{
"Time Complexity": "O()",
"Space Complexity": "O()",
"Thinking Time": 0,
"Coding Time": 0,
"Solutions": "",
"Use Hint": false,
"Use Solution": false
}
]
class Solution:
...
'''
This reporitory uses leetcode client as the client to pull leetcode submission and other operations. I added some new APIs to make it work.
This reporitory uses notion sdk as the client to update notion.