{"id":14975961,"url":"https://github.com/jamesmco/python_mcc_api","last_synced_at":"2025-07-19T11:06:53.782Z","repository":{"id":151442217,"uuid":"624205863","full_name":"JamesMCo/python_mcc_api","owner":"JamesMCo","description":"A wrapper for the MC Championship APIs (Event and Island)","archived":false,"fork":false,"pushed_at":"2025-07-17T15:35:21.000Z","size":157,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-17T16:19:06.408Z","etag":null,"topics":["graphql-client","mc-championship","mcc","mcc-island","minecraft","minecraft-event","minecraft-minigames","minecraft-server","python","python3","rest-client"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/mcc-api/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesMCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-06T01:08:39.000Z","updated_at":"2025-07-17T15:35:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ab004b5-42ca-4789-a923-2c386b72e878","html_url":"https://github.com/JamesMCo/python_mcc_api","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"74251239f5558e2b2bee0589e907fb15c69ad614"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/JamesMCo/python_mcc_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMCo%2Fpython_mcc_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMCo%2Fpython_mcc_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMCo%2Fpython_mcc_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMCo%2Fpython_mcc_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesMCo","download_url":"https://codeload.github.com/JamesMCo/python_mcc_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMCo%2Fpython_mcc_api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265921786,"owners_count":23849679,"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":["graphql-client","mc-championship","mcc","mcc-island","minecraft","minecraft-event","minecraft-minigames","minecraft-server","python","python3","rest-client"],"created_at":"2024-09-24T13:52:56.705Z","updated_at":"2025-07-19T11:06:53.775Z","avatar_url":"https://github.com/JamesMCo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python MCC API\n\n[![🐍 PyPI](https://img.shields.io/pypi/v/mcc-api?label=🐍%20PyPI)](https://pypi.org/project/mcc-api/)\n[![👑 Targeting Event API v1.6.0](https://img.shields.io/badge/👑_Targeting_Event_API-v1.6.0-red)](https://github.com/Noxcrew/mcchampionship-api/releases/tag/v1.6.0)\n[![🏝️ Targeting Island API v25.07.17](https://img.shields.io/badge/🏝️_Targeting_Island_API-v25.07.17-aqua)](https://github.com/Noxcrew/mccisland-api/releases/tag/v25.07.17)\n\nA helper library for the [MC Championship](https://mcchampionship.com) APIs\n([Event](https://github.com/Noxcrew/mcchampionship-api), inspired by [derNiklaas's](https://github.com/derNiklaas)\n[node-mcc-api](https://github.com/derNiklaas/node-mcc-api) project, and\n[Island](https://github.com/Noxcrew/mccisland-api)).\n\n- Issues: [https://github.com/JamesMCo/python_mcc_api/issues](https://github.com/JamesMCo/python_mcc_api/issues)\n- MCC Event API documentation: [https://api.mcchampionship.com/docs](https://api.mcchampionship.com/docs)\n- MCC Island API documentation: [https://api.mccisland.net/docs](https://api.mccisland.net/docs)\n- Module documentation: [https://mrjamesco.uk/python_mcc_api](https://mrjamesco.uk/python_mcc_api)\n- PyPI: [https://pypi.org/project/mcc-api/](https://pypi.org/project/mcc-api/)\n- Repository: [https://github.com/JamesMCo/python_mcc_api](https://github.com/JamesMCo/python_mcc_api)\n\n## Installation\n\nEnsure that [pip](https://packaging.python.org/en/latest/key_projects/#pip) is updated using:\n\n```bash\npython -m pip install --upgrade pip\n```\n\nThen install or update `mcc_api` using:\n\n```bash\npip install --upgrade mcc-api\n```\n\n## Usage\n\n### Event\n\nThe event library provides methods to call each of the endpoints described in the MC Championship Event API's\n[documentation](https://api.mcchampionship.com/docs).\n\n```python\nfrom datetime import datetime, timezone\nfrom mcc_api.event import get_event, get_rundown\n\n# Print information about the current event cycle\n\nevent = get_event()\nevent_name = event.data.event\nevent_start = event.data.date.strftime(\"%I%p UTC on %A %d %B %Y\")\n\nif event.data.date \u003c= datetime.now(tz=timezone.utc):\n    print(f\"The latest event (MCC {event_name}) started at {event_start}.\")\nelse:\n    print(f\"The upcoming event (MCC {event_name}) starts at {event_start}.\")\n\n\n# Print the names of the players that played in Dodgebolt in the latest event\n\nrundown = get_rundown()\n\ndodgebolt_teams = rundown.data.dodgeboltData.keys()\nplayers = sorted([player for team in dodgebolt_teams for player in rundown.data.creators[team]], key=str.casefold)\n\nprint(f\"The players that played in Dodgebolt in the latest event were:\\n- {'\\n- '.join(players)}\")\n```\n\n### Island\n\nThe island library provides an implementation of the GraphQL schema described in the MCC Island API's\n[documentation](https://api.mccisland.net/docs). Queries are written in GraphQL, and validated locally before being sent\nto the API.\n\nAccessing the MCC Island API requires an API key, which can be minted using\n[Noxcrew Gateway](https://gateway.noxcrew.com). Then, you can use `mcc_api.island.set_api_key(\"\u003cYOUR_API_KEY\u003e\")` to\nprovide authentication for all future requests. It is recommended that you store your API key in an environment\nvariable, and don't check it in to your source controlled repository.\n\n```python\nfrom gql import gql\nfrom mcc_api.island import client, set_api_key\n\nset_api_key(\"\u003cYOUR_API_KEY\u003e\")\n\n# Print some information about a given player\nquery = gql(\"\"\"\n    query player($username: String!) {\n        playerByUsername(username: $username) {\n            username\n            status {\n                online\n            }\n            collections {\n                currency {\n                    coins\n                }\n            }\n            social {\n                friends {\n                    uuid\n                }\n            }\n        }\n    }\n\"\"\")\ndata = client.execute(query, variable_values={\"username\": \"Jammy4312\"})\n\nplayer = data[\"playerByUsername\"]\nusername = player[\"username\"]\nusername_s = f\"{username}'{'' if player['username'][-1].lower() == 's' else 's'}\"\n\nprint(f\"Username: {username}\")\nif \"status\" in player:\n    print(f\"Status:   {'Online' if player['status']['online'] else 'Offline'}\")\nelse:\n    print(f\"Status:   Unknown ({username_s} status is private)\")\n\nif \"collections\" in player:\n    print(f\"Coins:    {player['collections']['currency']['coins']:,}\")\nelse:\n    print(f\"Coins:    Unknown ({username_s} collections are private)\")\n\nif \"social\" in player:\n    print(f\"Friends:  {len(player['social']['friends']):,}\")\nelse:\n    print(f\"Friends:  Unknown ({username_s} social data are private)\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmco%2Fpython_mcc_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesmco%2Fpython_mcc_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmco%2Fpython_mcc_api/lists"}