Classroom to Notion is an automation tool that integrates Google Classroom assignments (via Gmail) with Notion tasks using AI-powered parsing and matching.
- Fetch Classroom assignments from Gmail
- Retrieve existing activities from Notion
- AI-powered matching of assignments to activities
- Automatic creation of Notion tasks based on Classroom assignments
- Flexible parsing of different assignment formats
Before you begin, ensure you have met the following requirements:
- Python 3.7 or higher
- A Notion account with API access
- A Google account with Gmail API enabled
- Clone the repository:
git clone https://github.com/varadanvk/Classroom-to-Notion.git
cd Classroom-to-Notion
- Install the required dependencies:
pip install -r requirements.txt
- Set up Notion Integration:
- Go to Notion Integrations and create a new integration
- Note down the API key provided
- Share your Notion databases with the integration
- For more details, check out Notion's guide on creating integrations
- This is the Task Database Schema you can use as a reference
- Set up Gmail API:
- Follow the Gmail API Python Quickstart to:
- Enable the Gmail API
- Download your
credentials.json
file
- Place the
credentials.json
file in the project root
- Set up your environment variables:
-
Create a
.env
file in the project root -
Add the following variables:
NOTION_TOKEN=your_notion_api_token NOTION_DATABASE_ID=your_notion_tasks_database_id ACTIVITIES_DATABASE_ID=your_notion_activities_database_id CALENDAR_ACCOUNT=your_gmail_account
Note: If your school email doesn't allow access to Google Developers, set up email forwarding to a personal email address that you can use for API access.
- Find your Notion database IDs:
- Open your Notion databases
- The ID is in the URL: https://www.notion.so/username/DATABASE_ID?v=...
- Copy the DATABASE_ID part for both your tasks and activities databases
-
Update the
NOTION_DATABASE_ID
andACTIVITIES_DATABASE_ID
in your.env
file with these IDs -
Run the setup activities script:
python setup.py
This will prompt you to input your teacher's name for each activity. Once that is finished, all your activity relations will be added in.
- Run the scheduelr script:
python scheduler.py
- The script will:
- Fetch Classroom assignment emails from your Gmail
- Retrieve activities from your Notion database
- Match assignments to activities
- Create new tasks in Notion for the assignments
main.py
: The entry point of the applicationservices/
:classroom.py
: Handles interaction with the Gmail API to fetch Classroom assignmentsnotion.py
: Manages Notion API operationsassignment_parser.py
: Contains the parsing and matching logiccache_manager.py
: Manages caching of processed assignments
Contributions to the Classroom to Notion project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature
) - Make your changes
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE
file for details.
- Notion for their API
- Google for the Gmail API