Skip to main content

Wrapper for the MC Championship API

Project description

Python MCC API

A wrapper for the MC Championship API, inspired by derNiklaas's node-mcc-api project.

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]])}.")

Project details


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.0.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

mcc_api-1.0.0-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page