Skip to content

Automatically pull data from google classroom (via email) and put them in your notion database! This is intended for students whose schools dont allow them to access GFD

Notifications You must be signed in to change notification settings

varadanvk/Classroom-to-Notion

Repository files navigation

Classroom to Notion

Classroom to Notion is an automation tool that integrates Google Classroom assignments (via Gmail) with Notion tasks using AI-powered parsing and matching.

Features

  • 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

Prerequisites

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

Installation

  1. Clone the repository:
git clone https://github.com/varadanvk/Classroom-to-Notion.git
cd Classroom-to-Notion
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Set up Notion Integration:
  1. 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
  1. 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.

Usage

  1. Find your Notion database IDs:
  1. Update the NOTION_DATABASE_ID and ACTIVITIES_DATABASE_ID in your .env file with these IDs

  2. 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.

  1. Run the scheduelr script:
python scheduler.py
  1. 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

Project Structure

  • main.py: The entry point of the application
  • services/:
    • classroom.py: Handles interaction with the Gmail API to fetch Classroom assignments
    • notion.py: Manages Notion API operations
    • assignment_parser.py: Contains the parsing and matching logic
    • cache_manager.py: Manages caching of processed assignments

Contributing

Contributions to the Classroom to Notion project are welcome. Please follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Notion for their API
  • Google for the Gmail API

About

Automatically pull data from google classroom (via email) and put them in your notion database! This is intended for students whose schools dont allow them to access GFD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages