{"id":30249048,"url":"https://github.com/danbugs/daness","last_synced_at":"2025-08-15T08:07:51.222Z","repository":{"id":304564560,"uuid":"1019145034","full_name":"danbugs/daness","owner":"danbugs","description":"A Swiss tournament management tool for StartGG, designed for Microspacing Vancouver's format (5 rounds of Swiss → Main/Redemption brackets).","archived":false,"fork":false,"pushed_at":"2025-07-16T00:52:39.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-05T00:47:07.896Z","etag":null,"topics":["python","smash"],"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/danbugs.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-07-13T20:49:40.000Z","updated_at":"2025-07-16T00:52:42.000Z","dependencies_parsed_at":"2025-07-13T23:43:51.248Z","dependency_job_id":null,"html_url":"https://github.com/danbugs/daness","commit_stats":null,"previous_names":["danbugs/daness"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danbugs/daness","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fdaness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fdaness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fdaness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fdaness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danbugs","download_url":"https://codeload.github.com/danbugs/daness/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danbugs%2Fdaness/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270539673,"owners_count":24603203,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["python","smash"],"created_at":"2025-08-15T08:07:48.394Z","updated_at":"2025-08-15T08:07:51.213Z","avatar_url":"https://github.com/danbugs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# daness_v2\n\nA Swiss tournament management tool for StartGG, designed for Microspacing Vancouver's format (5 rounds of Swiss → Main/Redemption brackets).\n\nThis is V2 of the [original Daness controller](https://github.com/Tonychen0227/SmashExplorer/blob/640db23f07a647e9cbcfa3b1595c50680421cd80/SmashExplorerWeb/SmashExplorerWeb/Controllers/DanessController.cs).\n\n## Why This Tool?\n\nStartGG's default Swiss implementation has limitations:\n- Random pairings within score groups (e.g., seed #1 vs #2 in round 2)\n- Can't properly calculate final standings when Swiss feeds into multiple brackets\n- Manual pairing adjustments are tedious and error-prone\n\n## Features\n\n- **Proper Swiss pairings**: Uses traditional Swiss system with rematch avoidance and weekly variance to prevent repetitive matchups\n- **Points-based bracket seeding**: Custom scoring system with Cinderella run bonuses\n- **Automated final standings**: Correctly ranks players across Main/Redemption brackets\n- **Stream match recommendations**: Prioritizes high-stakes matches and compelling storylines over seed numbers\n- **Balanced bracket paths**: Ensures fair matchups in both brackets with rematch avoidance\n\n## Setup\n\n1. Clone the repository and set up Python environment:\n   ```bash\n   git clone https://github.com/danbugs/daness\n   cd daness\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   pip install -r requirements.txt\n   ```\n\n2. Set your StartGG API token:\n   ```bash\n   # Option 1: Environment variable\n   export STARTGG_TOKEN=\"your_token_here\"\n   \n   # Option 2: Create a .env file\n   echo \"STARTGG_TOKEN=your_token_here\" \u003e .env\n   ```\n\n3. Create your tournament structure in StartGG (see [Microspacing Vancouver 103](https://www.start.gg/tournament/microspacing-vancouver-103/events) as reference):\n   - 5 Swiss phases (Round 1-5)\n   - Main Bracket phase\n   - Redemption Bracket phase\n   - Final Standings phase (custom schedule)\n\n## Usage\n\n### Running Swiss Rounds\n```bash\n# Auto-detect next unstarted round\npython3 daness_v2.py \u003cevent-slug\u003e\n\n# Specify a specific round\npython3 daness_v2.py \u003cevent-slug\u003e 3\n```\n\n### After Swiss Completion\n```bash\n# Generate bracket seeding (shows who goes to Main vs Redemption)\npython3 daness_v2.py \u003cevent-slug\u003e bracket\n```\nThen in StartGG:\n1. Add players to Main/Redemption brackets using \"Bracket Setup\"\n2. Manually seed each bracket according to the tool's output\n\n### After Brackets Complete\n```bash\n# Calculate and update final standings\npython3 daness_v2.py \u003cevent-slug\u003e standings\n```\nThis updates the Final Standings phase with correct overall placements. Then finalize the standings in StartGG.\n\n## Example Workflow\n\n1. Before Round 1: Seed players in StartGG as normal\n2. Before Rounds 2-5: `python3 daness_v2.py tournament/example/event/singles`\n3. After Round 5: `python3 daness_v2.py tournament/example/event/singles bracket`\n4. Add and seed players to brackets as indicated\n5. After brackets finish: `python3 daness_v2.py tournament/example/event/singles standings`\n6. Finalize the Final Standings phase in StartGG\n\n## Notes\n\n- Initial seeding is saved to a file (e.g., `tournament-example-event-singles-seeding.txt`)\n- The tool prevents rematches when possible (verifies after each round)\n- Special handling for the crucial 2-2 matches in round 5 (bracket qualification)\n- Swiss pairings include controlled variance to prevent week-to-week repetition\n- Stream recommendations de-prioritize top seeds in favor of dramatic storylines\n- Requires all phases to be created in StartGG before running\n\n## Mock Tournament Generator\n\n- Creates fake players with seeds 1-32\n- Simulates match outcomes with configurable upset rates\n- Maintains tournament state through rounds\n\n### Test Scenarios\n\n- `test_no_rematches_standard()`\n   - Runs a full 5-round Swiss\n   - Verifies no rematches occur\n\n- `test_high_upset_tournament()`\n   - Tests with 40% upset rate\n   - Verifies Cinderella bonus calculations work correctly\n\n- `test_round_5_critical_matches()`\n   - Specifically tests the 2-2 group pairing logic\n   - Ensures fair seed matchups for bracket qualification\n\n- `test_constraint_satisfaction()`\n   - Creates difficult pairing scenarios\n   - Tests the rematch avoidance algorithm under stress\n\n- `test_bracket_seeding_fairness()`\n   - Verifies top 16 make main bracket\n   - Checks that seeding rewards performance properly\n\n- `test_edge_cases()`\n   - Extreme upset scenarios\n   - Other boundary conditions\n\n### Usage\n```bash\npython3 test_daness_v2.py\n```\n\n### Adding New Tests\n\nTo add a new test:\n```python\ndef test_my_scenario(self):\n    \"\"\"Test description\"\"\"\n    tournament = MockTournament(32, seed=12345)\n    \n    # Your test logic here\n    \n    return True  # or False if test fails\n```\n\nThen add to `run_all_tests()`:\n```python\nself.run_test(\"My Scenario\", self.test_my_scenario)\n```\n\nThis framework lets you:\n- Test edge cases without real tournaments\n- Reproduce bugs with specific seeds\n- Verify fixes don't break existing functionality\n- Ensure fairness in pairings and rankings\n\nYou can also create specific tournament scenarios by manipulating the match results directly to test particular situations (like everyone at 2-2 going into round 5).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fdaness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanbugs%2Fdaness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanbugs%2Fdaness/lists"}