This repository is designed to automate the onboarding and offboarding processes for the EcoCAR EV project using Python, Airflow, and Google APIs. The automation reduces manual effort by 50%, enhances secure communication using Google OAuth2 & Gmail API, and streamlines workflows hosted on GCP.
This system consists of three main components:
- Leader Approval System – Automates the acceptance/rejection of new members.
- Automated Email Notifications – Uses Gmail API to send structured onboarding emails.
- Google Sheets Integration – Manages and updates the team’s headcount automatically.
Additionally, Airflow has been implemented to fully automate the scheduling and execution of onboarding tasks.
✔️ Automated onboarding/offboarding using Python & Airflow, reducing manual tasks by 50%.
✔️ Integrated Google OAuth2 & Gmail API for secure communication & event scheduling.
✔️ Deployed automation on Google Cloud Platform (GCP) for efficiency & scalability.
✔️ Airflow DAG manages automated workflow execution.
📂 EcoCAR
│── 📂 Ask Leader to Accept or Decline
│ │── .env # Environment variables
│ │── AcceptOrDeclineReq.ipynb # Script for leader decision automation
│ │── client_secret.json # OAuth2 client secret for Google API
│ │── headcount.csv # Team member data for onboarding
│ │── testing-for-ecocar-ff6b5e5bbe13.json # Google API service credentials
│ │── token.json # OAuth2 authentication token
│ │── token.pickle # OAuth2 session persistence
│
│── 📂 Automated Message
│ │── .env # Environment variables
│ │── client_secret_171250538774.json # Google API credentials
│ │── email.ipynb # Automated email notification script
│ │── token.json # OAuth2 authentication token
│
│── 📂 Read Write Google Sheet
│ │── .env # Environment variables
│ │── headcount.csv # Team headcount data
│ │── test.ipynb # Google Sheets data manipulation
│ │── testing-for-ecocar-ff6b5e5bbe13.json # Google API credentials
│
│── 📂 Streamlit
│ │── Konsing Streamlit Test.zip # Streamlit UI test archive
│ │── photo.jpg # UI screenshot
│
│── 📂 Team Repository \ EcoCAR-Onboarding
│ │── .env # Environment variables
│ │── client_secret.json # OAuth2 client credentials
│ │── headcount.csv # Primary team data file
│ │── service_credentials.json # Google API service credentials
│ │── TestingForm.ipynb # Form validation notebook
│ │── token.pickle # OAuth2 session persistence
│
│── 📂 W’s Alt EcoCAR
│ │── credentials.json # Alternative Google API credentials
│ │── headcount.csv # Backup team data file
│ │── read.py # Data retrieval script
│ │── write.py # Data update script
│
│── .gitignore # Ignores sensitive files
│── Airflow_DAG_ecocar_onboarding.py # 🟢 Airflow DAG for automated workflow execution
│── main.py # Main script to orchestrate onboarding tasks
│── README.md # Project documentation
Ensure you have:
- Python 3.x installed.
- Required Python libraries (
pandas
,requests
,google-auth
, etc.). - Google API Access with OAuth2 credentials.
- Apache Airflow installed and configured.
1️⃣ Clone the Repository
git clone https://github.com/your-repo/EcoCAR-Onboarding.git
cd EcoCAR-Onboarding
2️⃣ Install Required Dependencies
pip install -r requirements.txt
3️⃣ Set Up Environment Variables
- Create a
.env
file and add necessary API keys or credentials:API_KEY=your_api_key_here
4️⃣ Run the Main Onboarding Script
python main.py
5️⃣ Start Jupyter Notebook for Form Testing
jupyter notebook TestingForm.ipynb
6️⃣ Deploy & Run the Airflow DAG (Locally)
- Move the DAG file to Airflow’s DAGs directory:
mv Airflow_DAG_ecocar_onboarding.py ~/airflow/dags/
- Restart the Airflow Scheduler:
airflow scheduler
- Start the Airflow Web UI:
airflow webserver --port 8080
- Open http://localhost:8080 and enable the DAG.
- Sends automated accept/reject requests to team leaders.
- Records responses in
headcount.csv
for tracking.
- Uses Gmail API to send structured onboarding emails.
- Supports dynamic placeholders for personalized messages.
- Reads & writes team headcount using Google Sheets API.
- Ensures real-time updates for team member tracking.
- Automates the onboarding pipeline:
- Checks for new onboarding requests.
- Emails team leaders for approval.
- Processes leader responses (Approve/Reject).
- Sends onboarding emails to accepted members.
- Updates Google Sheets with final decisions.
- Jupyter Notebook designed for validating and testing form data.
- Processes user responses, detects errors, and ensures data consistency.
- Stores Google API credentials for authentication.
- Used for OAuth2 authentication & service-based API access.
- Prevents sensitive files (
.env
,token.json
,.pickle
) from being committed.
- The central automation script that:
- Handles onboarding/offboarding.
- Automates leader decisions.
- Sends email notifications.
- Airflow DAG that fully automates the onboarding pipeline.
🔹 Auto-sync with Google Calendar – Schedule onboarding meetings dynamically.
🔹 AI-Powered Form Processing – Use NLP to analyze responses for anomalies.
This project is licensed under the MIT License.