This project integrates Codeforces with Notion, allowing you to visualize your solved problems and create interactive views for analysis.
1. Create a Notion Integration
-
Make sure you have a Notion account.
-
Go to Notion Integrations and create a new integration.
- Give it a name of your choice.
- Select the Internal integration type.
-
Save the Integration Token — it will be used later.
Create a new page in your Notion workspace to store your Codeforces submissions database.
-
Open the options of the page you created and connect it to your Notion integration.
-
Copy the Parent Page URL using the Share button. You'll need this URL later.
Ensure Python 3.8
or later is installed on your computer.
- Navigate to the project's root directory.
- Install dependencies:
pip install -r requirements.txt
Run the following command to execute the script:
python3 main.py
When prompted, provide the following:
- Your Notion Integration Token.
- The Parent Page URL.
- Your Codeforces username.
After execution, a new database will be created in your Parent Page, named as your Codeforces username. You can organize and personalize it, and even add charts for better visualization.
Therefore, you can create Databases from how many users you want, just changing the codeforces username on the CLI command.
- Manual Updates: You must rerun the script every time you want to update the database with new submissions.
- Public Data Only: The integration only retrieves publicly visible Codeforces submissions.
- One User per Database: Each database is linked to a single Codeforces user. For multiple users, create separate databases under the same parent page.
- Avoid Manual Edits: Adding rows manually in the database and editting property names and values (like the tag color) can cause issues.
- Other type of databases, like a Database that storage yours contests info like position, how many questions, score, delta, etc.
This project is built using pure Python, without any additional frameworks, focusing on simplicity and efficiency. It leverages the following libraries, listed in the requirements.txt
file:
requests
: To make HTTP requests to the Codeforces and Notion APIs.dotenv
: To securely manage environment variables, such as API tokens.json
(native): To process and structure the data retrieved from the APIs.
Codeforces API Integration
- Fetches public submissions of solved problems from your Codeforces account.
- Filters and structures the relevant data, such as problem ID, title, and submission status.
Notion API Integration
- Connects to your custom integration to create and update databases in your Notion workspace.
- Inserts structured submission data, enabling easy organization and customization within Notion.
Simplified Execution
- The code is designed to run with a single command after the initial setup.
Contributions to this project are more than welcome. Feel free to report a bug, suggest a improvement or submit a new feature.
Therefore, this project is licensed under the MIT License.
You are free to use, modify, and distribute this project, provided that the original license file is included in any copies or substantial portions of the software.
For more details, refer to the LICENSE file.