A Python automation tool that grants Google Drive and GitHub access to users via email.
- Python 3.11 or higher
- A Google Cloud service account with Google Drive API enabled
- GitHub Personal Access Token (PAT) or Organization Token
git clone https://github.com/Muthu1612/ivan_ruchkin_uf.git
cd ivan_ruchkin_ufOn Windows (PowerShell):
python -m venv ivan_envOn macOS/Linux:
python3.11 -m venv ivan_envOn Windows (PowerShell):
.\ivan_env\Scripts\Activate.ps1On Windows (Command Prompt):
.\ivan_env\Scripts\activate.batOn macOS/Linux:
source ivan_env/bin/activatepip install -r requirements.txtCreate a .env file in the project root directory with the following variables:
# GitHub Configuration
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_OWNER=your_github_username
# Google Drive Configuration
GOOGLE_SERVICE_ACCOUNT_FILE=creds/prod.json
GOOGLE_FILE_ID=your_google_drive_file_id
DEFAULT_SHARE_ROLE=reader
DEFAULT_EMAIL=your_email@example.comPlace your Google Cloud service account JSON file at:
creds/prod.json
python main.py-
The script prompts you to enter an email address:
Enter your email ID: user@example.com -
The script attempts to:
- Grant Google Drive access to the specified email
- Add the user as a collaborator to the GitHub repository
-
Output examples:
✅ Drive access given for: user@example.com ✅ Github access given for: user@example.comOr if there are errors:
❌ Failed to give Drive access for: user@example.com ❌ Failed to give Github access for: user@example.com
ivan_ruckhin/
├── main.py # Main entry point
├── google_service.py # Google Drive API integration
├── github_service.py # GitHub API integration
├── requirements.txt # Python dependencies
├── .env # Environment variables (not tracked)
├── .gitignore # Git ignore rules
└── creds/
└── prod.json # Google service account key (not tracked)
Make sure you have Python 3.11 installed:
python --versionIf you get an execution policy error on Windows:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserIf imports fail, ensure you activated the virtual environment and ran:
pip install -r requirements.txt- Google Drive: Verify
creds/prod.jsonexists and contains valid credentials - GitHub: Check that your
GITHUB_TOKENin.envhas the necessary permissions