### Install MTGA Log Client via Homebrew Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Install the MTGA Log Client on macOS using Homebrew. ```bash brew install seventeenlands ``` -------------------------------- ### Install MTGA Log Client via pip Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Install the Python package for cross-platform support or advanced usage. Requires Python 3.6+. ```bash pip3 install --user seventeenlands ``` -------------------------------- ### Get Client Version Info Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Checks if the current client version meets minimum requirements and handles the response logic. ```python # Version validation check response = client.get_client_version_info(params={ "client": "python", "version": "0.1.44" }) # Response example: # {"min_version": "0.1.40", "upgrade_instructions": "..."} import json version_info = json.loads(response.text) current = [0, 1, 44] minimum = [int(i) for i in version_info["min_version"].split(".")] if current >= minimum: print("Client version is supported") else: print(f"Upgrade required to version {version_info['min_version']}") ``` -------------------------------- ### GET /get_client_version_info Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Checks if the current client version meets minimum requirements. ```APIDOC ## GET /get_client_version_info ### Description Checks if the current client version meets minimum requirements. ### Method GET ### Endpoint /get_client_version_info ### Query Parameters - **client** (string) - Required - The client type (e.g., "python"). - **version** (string) - Required - The current client version (e.g., "0.1.44"). ### Request Example ```python response = client.get_client_version_info(params={ "client": "python", "version": "0.1.44" }) ``` ### Response #### Success Response (200) - **min_version** (string) - The minimum required client version. - **upgrade_instructions** (string) - Instructions on how to upgrade the client. #### Response Example ```json { "min_version": "0.1.40", "upgrade_instructions": "..." } ``` ``` -------------------------------- ### View all command-line options Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Display all available command-line arguments and their descriptions for the MTGA Log Client. ```bash python3 -m seventeenlands.mtga_follower -h ``` -------------------------------- ### Initialize Follower and Parse Logs Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Initializes the Follower class and demonstrates how to parse logs either once or continuously. ```python from seventeenlands.mtga_follower import Follower # Initialize with user token and API host follower = Follower( token="your-uuid-token", host="https://api.17lands.com" ) # Parse a log file once (for historical processing) follower.parse_log(filename="/path/to/Player.log", follow=False) # Parse and continue following for new entries follower.parse_log(filename="/path/to/Player.log", follow=True) ``` -------------------------------- ### Initialize ApiClient using default constant Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Initialize the ApiClient using the predefined DEFAULT_HOST constant for the 17Lands API. ```python client = seventeenlands.api_client.ApiClient( host=seventeenlands.api_client.DEFAULT_HOST ) ``` -------------------------------- ### Initialize ApiClient with default host Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Instantiate the ApiClient class to interact with the 17Lands REST API using the default host address. ```python import seventeenlands.api_client client = seventeenlands.api_client.ApiClient(host="https://api.17lands.com") ``` -------------------------------- ### Run MTGA Log Client with specific log file Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Specify a custom path to the MTGA Player.log file when running the client. ```bash python3 -m seventeenlands.mtga_follower -l /path/to/Player.log ``` -------------------------------- ### Run MTGA Log Client Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Execute the MTGA Log Client from the command line. It will prompt for your 17Lands token on the first run and save it to a configuration file. ```bash seventeenlands ``` -------------------------------- ### Manage Authentication Tokens in Python Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Reads and writes authentication tokens to a local .ini configuration file using configparser. ```python import configparser import os CONFIG_FILE = os.path.expanduser("~/.mtga_follower.ini") # Read existing config config = configparser.ConfigParser() if os.path.exists(CONFIG_FILE): config.read(CONFIG_FILE) token = config.get("client", "token", fallback=None) # Save new token if "client" not in config: config["client"] = {} config["client"]["token"] = "your-new-uuid-token" with open(CONFIG_FILE, "w") as f: config.write(f) # Config file format (~/.mtga_follower.ini): # [client] # token = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ``` -------------------------------- ### Use custom API host Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Configure the client to send data to a custom API host, typically used for testing purposes. ```bash python3 -m seventeenlands.mtga_follower --host https://custom-api.example.com ``` -------------------------------- ### Follower Initialization and Log Parsing Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Initializes the Follower class for processing MTGA log files. ```APIDOC ## Follower Initialization and Log Parsing ### Description The Follower class is the main log processor that monitors MTGA's Player.log file. ### Initialization ```python from seventeenlands.mtga_follower import Follower # Initialize with user token and API host follower = Follower( token="your-uuid-token", host="https://api.17lands.com" ) ``` ### Log Parsing #### Parse a log file once (for historical processing) ```python follower.parse_log(filename="/path/to/Player.log", follow=False) ``` #### Parse and continue following for new entries ```python follower.parse_log(filename="/path/to/Player.log", follow=True) ``` ``` -------------------------------- ### ApiClient Initialization Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Initializes the ApiClient class for communication with the 17Lands REST API. Supports default host or custom host. ```APIDOC ## ApiClient Initialization Initializes the ApiClient class for communication with the 17Lands REST API. ### Method ```python import seventeenlands.api_client # Initialize with default 17Lands host client = seventeenlands.api_client.ApiClient(host="https://api.17lands.com") # Or use the default client = seventeenlands.api_client.ApiClient( host=seventeenlands.api_client.DEFAULT_HOST ) ``` ``` -------------------------------- ### Version Comparison Logic Source: https://github.com/rconroy293/mtga-log-client/blob/master/clickonce/publish.htm Utility functions for parsing and comparing software version strings. ```javascript 0) return true; return false; } function GetVersion(v) { var a = v.match(/(\[0-9\]+)\.(\[0-9\]+)\.(\[0-9\]+)/i); if(a==null) a = v.match(/(\[0-9\]+)\.(\[0-9\]+)/i); return a.slice(1); } function CompareVersions(v1, v2) { if(v1.length>v2.length) { v2\[v2.length\]=0; } else if(v1.length n2) return 1; } return 0; } ``` -------------------------------- ### Run MTGA Log Follower via Terminal Source: https://github.com/rconroy293/mtga-log-client/blob/master/README.md Execute the log follower script directly from the command line using Python 3. ```bash python3 mtga_follower.py ``` -------------------------------- ### POST /api/submit_inventory Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits a snapshot of the player's current inventory, including currency, wildcards, and boosters. ```APIDOC ## POST /api/submit_inventory ### Description Submits a snapshot of the player's inventory, detailing their current holdings of gems, gold, wildcards, and booster packs. ### Method POST ### Endpoint /api/submit_inventory ### Request Body - **token** (string) - Required - Your authentication token. - **client_version** (string) - Required - The version of the client submitting the data. - **player_id** (string) - Required - The unique identifier for the player. - **time** (string) - Required - The local time of the inventory snapshot (ISO 8601 format). - **utc_time** (string) - Required - The UTC time of the inventory snapshot (ISO 8601 format). - **inventory** (object) - Required - An object containing various inventory details. - **Gems** (integer) - The number of gems owned. - **Gold** (integer) - The amount of gold owned. - **TotalVaultProgress** (number) - The percentage of vault progress. - **wcTrackPosition** (integer) - The current position in the wildcard track. - **WildCardCommons** (integer) - The number of common wildcards. - **WildCardUnCommons** (integer) - The number of uncommon wildcards. - **WildCardRares** (integer) - The number of rare wildcards. - **WildCardMythics** (integer) - The number of mythic rare wildcards. - **DraftTokens** (integer) - The number of draft tokens. - **SealedTokens** (integer) - The number of sealed tokens. - **Boosters** (array of objects) - A list of booster packs owned. - **CollationId** (integer) - The collation ID of the booster pack. - **SetCode** (string) - The set code for the booster pack (e.g., "MKM"). - **Count** (integer) - The number of boosters of this type. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "inventory": { "Gems": 3400, "Gold": 15000, "TotalVaultProgress": 87.5, "wcTrackPosition": 4, "WildCardCommons": 45, "WildCardUnCommons": 32, "WildCardRares": 8, "WildCardMythics": 3, "DraftTokens": 1, "SealedTokens": 0, "Boosters": [ {"CollationId": 100001, "SetCode": "MKM", "Count": 5}, {"CollationId": 100002, "SetCode": "LCI", "Count": 2} ] } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Log File Locations Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Lists the default file paths where the client searches for MTGA logs on various operating systems. ```text # Default log file search paths (in order of precedence): # macOS "~/Library/Logs/Wizards Of The Coast/MTGA/Player.log" # Steam (Linux) "~/.steam/steam/steamapps/compatdata/2141910/pfx/drive_c/users/steamuser/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" "~/.local/share/Steam/steamapps/compatdata/2141910/pfx/drive_c/users/steamuser/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" # Windows "C:/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" "D:/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" # Lutris (Linux) "~/Games/magic-the-gathering-arena/drive_c/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" # Wine (Linux) "~/.wine/drive_c/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log" # Or $WINEPREFIX if set ``` -------------------------------- ### Specify token directly Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Provide your 17Lands authentication token directly via the command line. This will override any token stored in the configuration file. ```bash python3 -m seventeenlands.mtga_follower --token YOUR_UUID_TOKEN ``` -------------------------------- ### Submit draft pick data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Record a specific card pick from a bot draft pack. Provide either a single card_id or a list for multi-pick scenarios. ```python # Example draft pick submission pick_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:15", "utc_time": "2024-01-15T19:30:15", "event_name": "QuickDraft_MKM_20240112", "pack_number": 1, "pick_number": 3, "card_id": 12345, # Single card picked "card_ids": None # Or list for multi-pick scenarios } response = client.submit_draft_pick(pick_data) ``` -------------------------------- ### Submit Human Draft Pick Data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Use this endpoint to submit data for a human draft pick, including card details and timing information. Ensure all required fields like token, client_version, player_id, and draft details are correctly populated. ```python human_pick_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:31:00", "utc_time": "2024-01-15T19:31:00", "draft_id": "DRAFT_SESSION_UUID", "event_name": "PremierDraft_MKM_20240112", "pack_number": 2, "pick_number": 5, "card_id": 12348, "auto_pick": False, "time_remaining": 45.5 # Seconds remaining when pick was made } response = client.submit_human_draft_pick(human_pick_data) ``` -------------------------------- ### submit_draft_pack Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits a draft pack for bot drafts when the user sees available cards. Requires authentication token and game event details. ```APIDOC ## POST /api/submit_draft_pack Submits a draft pack for bot drafts when the user sees available cards. ### Method POST ### Endpoint /api/submit_draft_pack ### Request Body - **token** (string) - Required - Your 17Lands authentication token. - **client_version** (string) - Required - The version of the MTGA Log Client. - **player_id** (string) - Required - The player's account ID. - **time** (string) - Required - Local time of the event (ISO 8601 format). - **utc_time** (string) - Required - UTC time of the event (ISO 8601 format). - **event_name** (string) - Required - Name of the draft event (e.g., "QuickDraft_MKM_20240112"). - **pack_number** (integer) - Required - The number of the pack in the draft (1-3). - **pick_number** (integer) - Required - The pick number within the pack (1-15). - **card_ids** (array of integers) - Required - A list of card IDs available in the pack. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:00", "utc_time": "2024-01-15T19:30:00", "event_name": "QuickDraft_MKM_20240112", "pack_number": 1, "pick_number": 3, "card_ids": [12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352, 12353, 12354, 12355, 12356] } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Log File Locations Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Provides default log file search paths for different operating systems and platforms. ```APIDOC ## Log File Locations ### Description The client automatically searches for MTGA log files in platform-specific locations. ### Default log file search paths (in order of precedence): #### macOS `~/Library/Logs/Wizards Of The Coast/MTGA/Player.log` #### Steam (Linux) `~/.steam/steam/steamapps/compatdata/2141910/pfx/drive_c/users/steamuser/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` `~/.local/share/Steam/steamapps/compatdata/2141910/pfx/drive_c/users/steamuser/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` #### Windows `C:/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` `D:/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` #### Lutris (Linux) `~/Games/magic-the-gathering-arena/drive_c/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` #### Wine (Linux) `~/.wine/drive_c/users/{username}/AppData/LocalLow/Wizards Of The Coast/MTGA/Player.log` # Or $WINEPREFIX if set ``` -------------------------------- ### Submit Player Inventory Data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits player inventory, including gems, gold, wildcards, and boosters. The inventory structure details counts for various in-game assets and booster pack types. ```python # Inventory snapshot inventory_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "inventory": { "Gems": 3400, "Gold": 15000, "TotalVaultProgress": 87.5, "wcTrackPosition": 4, "WildCardCommons": 45, "WildCardUnCommons": 32, "WildCardRares": 8, "WildCardMythics": 3, "DraftTokens": 1, "SealedTokens": 0, "Boosters": [ {"CollationId": 100001, "SetCode": "MKM", "Count": 5}, {"CollationId": 100002, "SetCode": "LCI", "Count": 2} ] } } response = client.submit_inventory(inventory_data) ``` -------------------------------- ### submit_human_draft_pick Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Records picks made in Premier/Traditional human drafts with timing information. Requires authentication token and pick details. ```APIDOC ## POST /api/submit_human_draft_pick Records picks made in Premier/Traditional human drafts with timing information. ### Method POST ### Endpoint /api/submit_human_draft_pick ### Request Body - **token** (string) - Required - Your 17Lands authentication token. - **client_version** (string) - Required - The version of the MTGA Log Client. - **player_id** (string) - Required - The player's account ID. - **time** (string) - Required - Local time of the event (ISO 8601 format). - **utc_time** (string) - Required - UTC time of the event (ISO 8601 format). - **draft_id** (string) - Required - Unique identifier for the draft session. - **event_name** (string) - Required - Name of the draft event (e.g., "PremierDraft_MKM_20240112"). - **pack_number** (integer) - Required - The number of the pack in the draft (1-3). - **pick_number** (integer) - Required - The pick number within the pack (1-15). - **card_id** (integer) - Required - The ID of the card picked. - **method** (string) - Required - Method used to capture data (e.g., "LogBusiness", "Draft.Notify"). ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:15", "utc_time": "2024-01-15T19:30:15", "draft_id": "DRAFT_SESSION_UUID", "event_name": "PremierDraft_MKM_20240112", "pack_number": 2, "pick_number": 5, "card_id": 12345, "method": "LogBusiness" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Submit Game Result Data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits complete game data, including hands, draws, turns, and match history. The data can be gzip compressed. This endpoint requires detailed information about the game state, player actions, and outcomes. ```python # Complete game result with full history game_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T15:30:00", "utc_time": "2024-01-15T20:30:00", "event_name": "QuickDraft_MKM_20240112", "match_id": "MATCH_UUID", "game_number": 1, "on_play": True, "opening_hand": [12345, 12346, 12347, 12348, 12349, 12350, 12351], "mulligans": [[12352, 12353, 12354, 12355, 12356, 12357, 12358]], # Hands mulled "drawn_hands": [ [12352, 12353, 12354, 12355, 12356, 12357, 12358], # 7-card hand [12345, 12346, 12347, 12348, 12349, 12350] # 6-card kept ], "drawn_cards": [12345, 12346, 12359, 12360, 12361], "mulligan_count": 1, "opponent_mulligan_count": 0, "turns": 8, "duration": -1, "won": True, "win_type": "ResultType_Concede", "game_end_reason": "ResultReason_Concede", "opponent_card_ids": [23456, 23457, 23458, 23459], "rank_data": {"limitedSeasonOrdinal": 15, "limitedClass": "Gold", "limitedLevel": 2}, "opponent_rank": "Gold-3-0.0-0-2", "maindeck_card_ids": [12345, 12345, 12346], # Current game deck "sideboard_card_ids": [12384, 12385], "history": { "seat_id": 1, "opponent_seat_id": 2, "screen_name": "YourName", "opponent_screen_name": "OpponentName", "events": [] # Full game state history } } response = client.submit_game_result(game_data) ``` -------------------------------- ### Submit Ongoing Events Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Updates the list of events the player is currently enrolled in by providing course details and deck information. ```python # Active event courses events_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "courses": [ { "CourseId": "COURSE_UUID_1", "InternalEventName": "QuickDraft_MKM_20240112", "CurrentWins": 3, "CurrentLosses": 1, "CourseDeck": {"MainDeck": [], "Sideboard": []} }, { "CourseId": "COURSE_UUID_2", "InternalEventName": "PremierDraft_MKM_20240112", "CurrentWins": 5, "CurrentLosses": 2, "CourseDeck": {"MainDeck": [], "Sideboard": []} } ] } response = client.submit_ongoing_events(events_data) ``` -------------------------------- ### submit_draft_pick Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Records which card was picked from a bot draft pack. Requires authentication token and pick details. ```APIDOC ## POST /api/submit_draft_pick Records which card was picked from a bot draft pack. ### Method POST ### Endpoint /api/submit_draft_pick ### Request Body - **token** (string) - Required - Your 17Lands authentication token. - **client_version** (string) - Required - The version of the MTGA Log Client. - **player_id** (string) - Required - The player's account ID. - **time** (string) - Required - Local time of the event (ISO 8601 format). - **utc_time** (string) - Required - UTC time of the event (ISO 8601 format). - **event_name** (string) - Required - Name of the draft event (e.g., "QuickDraft_MKM_20240112"). - **pack_number** (integer) - Required - The number of the pack in the draft (1-3). - **pick_number** (integer) - Required - The pick number within the pack (1-15). - **card_id** (integer) - Required - The ID of the card picked. - **card_ids** (array of integers or null) - Optional - List of card IDs in the pack if not submitted via `submit_draft_pack`. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:15", "utc_time": "2024-01-15T19:30:15", "event_name": "QuickDraft_MKM_20240112", "pack_number": 1, "pick_number": 3, "card_id": 12345, "card_ids": null } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### POST /api/submit_human_draft_pick Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits data related to a human player's pick during a draft, including timing and auto-pick information. ```APIDOC ## POST /api/submit_human_draft_pick ### Description Records a human player's pick in a draft, including details like pack number, pick number, card chosen, and whether it was an auto-pick. ### Method POST ### Endpoint /api/submit_human_draft_pick ### Request Body - **token** (string) - Required - Your authentication token. - **client_version** (string) - Required - The version of the client submitting the data. - **player_id** (string) - Required - The unique identifier for the player. - **time** (string) - Required - The local time when the pick was made (ISO 8601 format). - **utc_time** (string) - Required - The UTC time when the pick was made (ISO 8601 format). - **draft_id** (string) - Required - The unique identifier for the draft session. - **event_name** (string) - Required - The name of the event (e.g., PremierDraft_MKM_20240112). - **pack_number** (integer) - Required - The number of the pack from which the pick was made (1-3). - **pick_number** (integer) - Required - The number of the pick within the pack (1-15). - **card_id** (integer) - Required - The unique identifier of the card picked. - **auto_pick** (boolean) - Required - Indicates if the pick was made automatically. - **time_remaining** (number) - Optional - Seconds remaining on the timer when the pick was made. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:31:00", "utc_time": "2024-01-15T19:31:00", "draft_id": "DRAFT_SESSION_UUID", "event_name": "PremierDraft_MKM_20240112", "pack_number": 2, "pick_number": 5, "card_id": 12348, "auto_pick": false, "time_remaining": 45.5 } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### POST /submit_ongoing_events Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Updates the list of events the player is currently enrolled in. ```APIDOC ## POST /submit_ongoing_events ### Description Updates the list of events the player is currently enrolled in. ### Method POST ### Endpoint /submit_ongoing_events ### Request Body - **token** (string) - Required - The user's authentication token. - **client_version** (string) - Required - The version of the client submitting the data. - **player_id** (string) - Required - The unique identifier for the player. - **time** (string) - Required - The local time when the data was recorded (ISO 8601 format). - **utc_time** (string) - Required - The UTC time when the data was recorded (ISO 8601 format). - **courses** (array) - Required - A list of active event courses. - Each item in the array is an object with the following fields: - **CourseId** (string) - Required - The unique identifier for the course. - **InternalEventName** (string) - Required - The internal name of the event. - **CurrentWins** (integer) - Required - The current number of wins in the event. - **CurrentLosses** (integer) - Required - The current number of losses in the event. - **CourseDeck** (object) - Required - The deck used in the course. - **MainDeck** (array) - Required - List of cards in the main deck. - **Sideboard** (array) - Required - List of cards in the sideboard. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "courses": [ { "CourseId": "COURSE_UUID_1", "InternalEventName": "QuickDraft_MKM_20240112", "CurrentWins": 3, "CurrentLosses": 1, "CourseDeck": {"MainDeck": [], "Sideboard": []} }, { "CourseId": "COURSE_UUID_2", "InternalEventName": "PremierDraft_MKM_20240112", "CurrentWins": 5, "CurrentLosses": 2, "CourseDeck": {"MainDeck": [], "Sideboard": []} } ] } ``` ### Response (Success response details not provided in the source text) #### Success Response (200) (Details not provided in the source text) #### Response Example (Details not provided in the source text) ``` -------------------------------- ### POST /api/submit_deck_submission Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Records the final decklist submitted for an event, including maindeck, sideboard, and companion cards. ```APIDOC ## POST /api/submit_deck_submission ### Description Submits the final decklist constructed for an event, including all maindeck cards, sideboard cards, and an optional companion card. ### Method POST ### Endpoint /api/submit_deck_submission ### Request Body - **token** (string) - Required - Your authentication token. - **client_version** (string) - Required - The version of the client submitting the data. - **player_id** (string) - Required - The unique identifier for the player. - **time** (string) - Required - The local time when the deck was submitted (ISO 8601 format). - **utc_time** (string) - Required - The UTC time when the deck was submitted (ISO 8601 format). - **event_name** (string) - Required - The name of the event (e.g., QuickDraft_MKM_20240112). - **maindeck_card_ids** (array of integers) - Required - A list of card IDs representing the main deck (typically 60 cards). - **sideboard_card_ids** (array of integers) - Required - A list of card IDs representing the sideboard (typically 15 cards). - **companion** (integer) - Optional - The card ID of the chosen companion, or 0 if none. - **is_during_match** (boolean) - Required - Indicates if the deck submission is happening during a match. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T15:00:00", "utc_time": "2024-01-15T20:00:00", "event_name": "QuickDraft_MKM_20240112", "maindeck_card_ids": [12345, 12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352, 12353, 12354, 12355, 12356, 12357, 12358, 12359, 12360, 12361, 12362, 12363, 12364, 12365, 12366, 12367, 12368, 12369, 12370, 12371, 12372, 12373, 12374, 12375, 12376, 12377, 12378, 12379, 12380, 12381, 12382, 12383], "sideboard_card_ids": [12384, 12385, 12386, 12387, 12388], "companion": 12389, "is_during_match": false } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### POST /submit_rank Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits the player's current rank data to the API. ```APIDOC ## POST /submit_rank ### Description Submits the player's current rank data to the API. ### Method POST ### Endpoint /submit_rank ### Request Body - **token** (string) - Required - The user's authentication token. - **client_version** (string) - Required - The version of the client submitting the data. - **player_id** (string) - Required - The unique identifier for the player. - **time** (string) - Required - The local time when the data was recorded (ISO 8601 format). - **utc_time** (string) - Required - The UTC time when the data was recorded (ISO 8601 format). - **rank_data** (object) - Required - An object containing detailed rank information. - **playerId** (string) - Required - The player's account ID. - **limitedSeasonOrdinal** (integer) - Required - The ordinal number of the limited season. - **limitedClass** (string) - Required - The player's rank class in limited format. - **limitedLevel** (integer) - Required - The player's rank level in limited format. - **limitedPercentile** (number) - Required - The player's percentile in limited format. - **limitedLeaderboardPlace** (integer) - Required - The player's leaderboard place in limited format. - **limitedStep** (integer) - Required - The player's rank step in limited format. - **constructedSeasonOrdinal** (integer) - Required - The ordinal number of the constructed season. - **constructedClass** (string) - Required - The player's rank class in constructed format. - **constructedLevel** (integer) - Required - The player's rank level in constructed format. - **constructedPercentile** (number) - Required - The player's percentile in constructed format. - **constructedLeaderboardPlace** (integer) - Required - The player's leaderboard place in constructed format. - **constructedStep** (integer) - Required - The player's rank step in constructed format. - **limited_rank** (any) - Optional - Placeholder for limited rank details. - **constructed_rank** (any) - Optional - Placeholder for constructed rank details. ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "rank_data": { "playerId": "PLAYER_ACCOUNT_ID", "limitedSeasonOrdinal": 15, "limitedClass": "Platinum", "limitedLevel": 2, "limitedPercentile": 0.0, "limitedLeaderboardPlace": 0, "limitedStep": 3, "constructedSeasonOrdinal": 15, "constructedClass": "Gold", "constructedLevel": 4, "constructedPercentile": 0.0, "constructedLeaderboardPlace": 0, "constructedStep": 1 }, "limited_rank": null, "constructed_rank": null } ``` ### Response (Success response details not provided in the source text) #### Success Response (200) (Details not provided in the source text) #### Response Example (Details not provided in the source text) ``` -------------------------------- ### submit_human_draft_pack Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits pack information for Premier/Traditional (human) drafts. Includes draft session ID and method of data capture. ```APIDOC ## POST /api/submit_human_draft_pack Submits pack information for Premier/Traditional (human) drafts. ### Method POST ### Endpoint /api/submit_human_draft_pack ### Request Body - **token** (string) - Required - Your 17Lands authentication token. - **client_version** (string) - Required - The version of the MTGA Log Client. - **player_id** (string) - Required - The player's account ID. - **time** (string) - Required - Local time of the event (ISO 8601 format). - **utc_time** (string) - Required - UTC time of the event (ISO 8601 format). - **draft_id** (string) - Required - Unique identifier for the draft session. - **event_name** (string) - Required - Name of the draft event (e.g., "PremierDraft_MKM_20240112"). - **pack_number** (integer) - Required - The number of the pack in the draft (1-3). - **pick_number** (integer) - Required - The pick number within the pack (1-15). - **card_ids** (array of integers) - Required - A list of card IDs available in the pack. - **method** (string) - Required - Method used to capture data (e.g., "LogBusiness", "Draft.Notify"). ### Request Example ```json { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:00", "utc_time": "2024-01-15T19:30:00", "draft_id": "DRAFT_SESSION_UUID", "event_name": "PremierDraft_MKM_20240112", "pack_number": 2, "pick_number": 5, "card_ids": [12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352, 12353], "method": "LogBusiness" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates success. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Submit draft pack data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Send data for a draft pack to the 17Lands API. This is used for bot drafts when cards are visible. ```python # Example draft pack submission pack_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T14:30:00", "utc_time": "2024-01-15T19:30:00", "event_name": "QuickDraft_MKM_20240112", "pack_number": 1, "pick_number": 3, "card_ids": [12345, 12346, 12347, 12348, 12349, 12350, 12351, 12352, 12353, 12354, 12355, 12356] } response = client.submit_draft_pack(pack_data) # Returns: requests.Response with status 200 on success ``` -------------------------------- ### Submit Rank Data Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Submits player rank information to the API using a dictionary containing player IDs and season statistics. ```python rank_data = { "token": "your-uuid-token", "client_version": "0.1.44.p", "player_id": "PLAYER_ACCOUNT_ID", "time": "2024-01-15T16:00:00", "utc_time": "2024-01-15T21:00:00", "rank_data": { "playerId": "PLAYER_ACCOUNT_ID", "limitedSeasonOrdinal": 15, "limitedClass": "Platinum", "limitedLevel": 2, "limitedPercentile": 0.0, "limitedLeaderboardPlace": 0, "limitedStep": 3, "constructedSeasonOrdinal": 15, "constructedClass": "Gold", "constructedLevel": 4, "constructedPercentile": 0.0, "constructedLeaderboardPlace": 0, "constructedStep": 1 }, "limited_rank": None, "constructed_rank": None } response = client.submit_rank(rank_data) ``` -------------------------------- ### Parse log once without following Source: https://context7.com/rconroy293/mtga-log-client/llms.txt Process the MTGA log file once without continuously monitoring for new events. Useful for analyzing historical log data. ```bash python3 -m seventeenlands.mtga_follower --once ```