Automated license management system for Zoom that assigns and unassigns licenses based on a predefined schedule.
To run the license manager at 1 AM Monday–Friday:
Open your crontab:
crontab -e
Add:
0 1 * * 1-5 cd /path/to/zoom && /path/to/venv/bin/python app.py >> /var/log/zoom_license_manager.log 2>&1
Replace the paths with your project directory and venv Python.
(Optional) Tail logs:
tail -f /var/log/zoom_license_manager.log
Create /etc/logrotate.d/zoom-license-manager:
/var/log/zoom_license_manager.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 0640 root root
}
Clone the repository:
git clone git@github.com:bkyalo/zoom.git
cd zoom
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Copy the example environment file and fill in credentials:
cp .env.example .env
# Edit .env with your Zoom and database credentials
Edit .env (see .env.example):
# Zoom API Configuration
ZOOM_ACCOUNT_ID=your_zoom_account_id
ZOOM_CLIENT_ID=your_zoom_client_id
ZOOM_CLIENT_SECRET=your_zoom_client_secret
# Database Configuration
DB_HOST=localhost
DB_USER=your_db_username
DB_PASSWORD=your_db_password
DB_NAME=your_database_name
# Application Settings
ENVIRONMENT=development
LOG_LEVEL=INFO
Optional (not required to run):
# Telegram notifications (skipped if unset)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
Daily automation:
python app.py
# or
./run.sh
python assign.py user@example.com
python unassign.py user@example.com
Bulk-clear licenses from users listed in zoomus_users.csv (e.g. end of semester).
python3 unassign_massive.py
python3 unassign_massive.py --execute
Assign licenses to everyone scheduled for today (full set, not a diff):
python3 assign_today.py
python3 assign_today.py --execute
Each run reports total / used / available licenses and warns when fewer than 10% remain.
from assign import get_license_usage
usage = get_license_usage()
if usage:
print(f"Total: {usage['total_licenses']}")
print(f"Used: {usage['used_licenses']}")
print(f"Available: {usage['available_licenses']}")
🚀 Starting license management...
==================================================
📅 Today is: Friday
📅 Yesterday was: Thursday
📋 Fetching schedule...
✅ Successfully connected to the database.
📊 License Usage:
• Total Licenses: 100
• Used Licenses: 85
• Available Licenses: 15
📊 Summary:
- Found 5 users to unassign
- Found 3 users to assign
🔴 Unassigning licenses for 5 users...
1. Unassigning from user1@example.com... ✅ Done
...
🟢 Assigning licenses to 3 users...
1. Assigning to newuser@example.com... ✅ Done
...
==================================================
✅ License management completed!
This project is licensed under the MIT License — see the LICENSE file for details.