Python MCC API
A wrapper for the MC Championship API, inspired by derNiklaas's node-mcc-api project.
- Issues: https://github.com/JamesMCo/python_mcc_api/issues
- MCC API documentation: https://api.mcchampionship.com/docs
- Module documentation: https://mrjamesco.uk/python_mcc_api
- PyPI: https://pypi.org/project/mcc-api/
- Repository: https://github.com/JamesMCo/python_mcc_api
Installation
Ensure that pip is updated using:
python -m pip install --upgrade pip
Then install or update mcc_api using:
pip install --upgrade mcc-api
Usage
import mcc_api
# Print information about the current event cycle
from datetime import datetime, timezone
event = mcc_api.get_event()
if event.data.date <= datetime.now(tz=timezone.utc):
print(f"The latest event (MCC {event.data.event}) started at {event.data.date.strftime('%I%p UTC on %A %d %B %Y')}.")
else:
print(f"The upcoming event (MCC {event.data.event}) starts at {event.data.date.strftime('%I%p UTC on %A %d %B %Y')}.")
# Print the names of the players that played in Dodgebolt in the latest event
rundown = mcc_api.get_rundown()
dodgebolt_teams = rundown.data.dodgeboltData.keys()
players = sorted([player for team in dodgebolt_teams for player in rundown.data.creators[team]], key=str.casefold)
print(f"The players that played in Dodgebolt in the latest event were {', and '.join([', '.join(players[:-1]), players[-1]])}.")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mcc_api-1.0.7.tar.gz
(19.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcc_api-1.0.7.tar.gz.
File metadata
- Download URL: mcc_api-1.0.7.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c14bca557a4324b1e397aca458bc5dcdbf802044e8dec2b5b75f8ff992b33f8
|
|
| MD5 |
66489a054f0b6d85006cc449f1867418
|
|
| BLAKE2b-256 |
cdea7b7062322dee38633b343fa9472f9bd6a46414ebce9a1f462d08324d7089
|
File details
Details for the file mcc_api-1.0.7-py3-none-any.whl.
File metadata
- Download URL: mcc_api-1.0.7-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1096a39aa3091f099e5c06ab7a54ff7768eeef88db54df6a75bffbb3661e458c
|
|
| MD5 |
4f598536bddbd4de4778ba4b752d1d96
|
|
| BLAKE2b-256 |
c829a694fb3bf1eb6803433f5107b4b884de7dc850d338024a658d0c83662755
|