{"id":29196106,"url":"https://github.com/jparker23/badgr_group_exp_automation","last_synced_at":"2026-05-17T01:46:23.718Z","repository":{"id":301581286,"uuid":"1009699376","full_name":"Jparker23/badgr_group_exp_automation","owner":"Jparker23","description":"Streamline Badgr platform management with Python scripts for batch group updates, badge class counting, and automated expiration date changes","archived":false,"fork":false,"pushed_at":"2025-06-27T17:56:03.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T17:04:38.069Z","etag":null,"topics":["api-integration","automation","badgr","bulk-processing","playwright","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jparker23.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-27T15:02:50.000Z","updated_at":"2025-06-27T17:56:06.000Z","dependencies_parsed_at":"2025-06-27T16:36:06.162Z","dependency_job_id":"27344c7d-ee46-4ca3-a594-b6bae31a8f8e","html_url":"https://github.com/Jparker23/badgr_group_exp_automation","commit_stats":null,"previous_names":["jparker23/ows_group_automation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jparker23/badgr_group_exp_automation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jparker23%2Fbadgr_group_exp_automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jparker23%2Fbadgr_group_exp_automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jparker23%2Fbadgr_group_exp_automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jparker23%2Fbadgr_group_exp_automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jparker23","download_url":"https://codeload.github.com/Jparker23/badgr_group_exp_automation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jparker23%2Fbadgr_group_exp_automation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265175567,"owners_count":23722661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-integration","automation","badgr","bulk-processing","playwright","python"],"created_at":"2025-07-02T06:00:40.499Z","updated_at":"2026-05-17T01:46:23.648Z","avatar_url":"https://github.com/Jparker23.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Badgr Automation Tools\n\nA collection of Python scripts for automating common tasks with the Badgr digital badge platform, including badge class management and group expiration date updates.\n\n## Overview\n\nThis repository contains four main scripts designed to streamline Badgr administration:\n\n1. **Badge Class Management** - Retrieve and count unique badge classes via API\n2. **Group Link Extraction** - Scrape group management links from the web interface\n3. **Batch Group Updates** - Update group expiration dates concurrently (high performance)\n4. **Sequential Group Updates** - Update group expiration dates one at a time (more stable)\n\n## Scripts\n\n### `get_badge_ids.py`\nConnects to the Badgr API to retrieve all badge classes and count unique entities.\n\n**Features:**\n- Uses HTTPS connection to Badgr API\n- Counts unique badge classes by entityId\n- Requires Bearer token authentication\n\n### `get_group_links.py`\nWeb scrapes the Badgr interface to extract group management links.\n\n**Features:**\n- Automated login to Badgr web interface\n- Navigates through paginated group listings\n- Exports group edit links to CSV file\n- Handles up to 100 results per page for efficiency\n\n### `group_date_auto_batch.py`\nHigh-performance batch processing script for updating group expiration dates.\n\n**Features:**\n- Concurrent processing (configurable number of simultaneous operations)\n- Asynchronous execution for faster processing\n- Built-in verification of updates\n- Progress tracking and error handling\n- Headless browser operation\n\n### `group_date_auto_single.py`\nSequential processing script for updating group expiration dates.\n\n**Features:**\n- Single-threaded, stable execution\n- Step-by-step processing with detailed logging\n- Interactive mode for debugging (headless=False)\n- Automatic error detection and pause functionality\n\n## Prerequisites\n\n### Python Dependencies\n```bash\npip install playwright\n```\n\n### Playwright Browser Setup\n```bash\nplaywright install chromium\n```\n\n### Required Credentials\nYou'll need to configure the following in each script:\n\n1. **Badgr API Token** (for `get_badge_ids.py`)\n   - Set the `Bearer` variable with your API token\n\n2. **Badgr Login Credentials** (for web automation scripts)\n   - Set `login_email` and `login_password` variables\n   - **⚠️ Security Note:** Remove credentials before committing to version control\n\n## Usage\n\n### 1. Get Badge Class Count\n```bash\npython get_badge_ids.py\n```\n\n### 2. Extract Group Links\n```bash\npython get_group_links.py\n```\nThis creates `group_links.csv` with all group management URLs.\n\n### 3. Update Group Expiration Dates\n\n**For high-volume processing (recommended for 1000+ groups):**\n```bash\npython group_date_auto_batch.py\n```\n\n**For smaller batches or debugging:**\n```bash\npython group_date_auto_single.py\n```\n\n## Configuration\n\n### Expiration Date\nSet your desired expiration date in the group update scripts:\n```python\nnew_exp_date = \"6/24/2031\"  # MM/DD/YYYY format\n```\n\n### Concurrent Operations\nAdjust the concurrency limit in `group_date_auto_batch.py`:\n```python\nMAX_CONCURRENT = 20  # Reduce if experiencing timeouts\n```\n\n### CSV Output File\nCustomize the output filename in `get_group_links.py`:\n```python\ncsv_name = \"group_links.csv\"\n```\n\n## Workflow\n\n1. **Extract Group Links**: Run `get_group_links.py` to generate a CSV of all group edit URLs\n2. **Update Expiration Dates**: Use either batch or single script to update group expiration dates\n3. **Verification**: Both update scripts include built-in verification to ensure changes were applied correctly\n\n## Error Handling\n\n- **Timeouts**: Scripts include timeout handling for slow-loading pages\n- **Login Detection**: Automatic re-authentication if session expires\n- **Verification**: Date changes are verified after each update\n- **Progress Tracking**: Real-time progress reporting with completion percentages\n\n## Security Considerations\n\n- **Never commit credentials** to version control\n- Use environment variables or config files for sensitive data\n- Consider using Badgr API instead of web scraping when possible\n- Review and test scripts in a development environment first\n\n## Troubleshooting\n\n### Common Issues\n\n**Authentication Errors:**\n- Verify your Badgr credentials are correct\n- Check if your account has necessary permissions\n- Ensure API token is valid and not expired\n\n**Timeout Issues:**\n- Reduce `MAX_CONCURRENT` value in batch script\n- Increase timeout values in script configuration\n- Check network connectivity\n\n**Date Format Issues:**\n- Ensure date format matches MM/DD/YYYY\n- Verify the target date is valid and in the future\n\n### Debug Mode\nSet `headless=False` in browser launch options to watch the automation in action:\n```python\nbrowser = playwright.chromium.launch(headless=False)\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Remove any credentials from code\n5. Submit a pull request\n\n## License\n\nThis project is provided as-is for educational and administrative purposes. Please ensure compliance with Badgr's terms of service when using these automation tools.\n\n## Disclaimer\n\nThese scripts are designed for legitimate administrative use of Badgr platforms. Users are responsible for:\n- Complying with Badgr's terms of service\n- Ensuring proper authorization before running automation scripts\n- Testing scripts in development environments before production use\n- Protecting credentials and sensitive data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparker23%2Fbadgr_group_exp_automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjparker23%2Fbadgr_group_exp_automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjparker23%2Fbadgr_group_exp_automation/lists"}