All Projects → evonove → mkm-sdk

evonove / mkm-sdk

Licence: MIT license
Python SDK for Magickartenmarkt API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to mkm-sdk

Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (+448.48%)
Mutual labels:  api-wrapper, api-rest
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (+727.27%)
Mutual labels:  api-wrapper, api-rest
Swiftfall
Wrapper for Scryfall API written in Swift
Stars: ✭ 21 (-36.36%)
Mutual labels:  api-wrapper, mtg-api
valorant.py
Complete Python interface for the Valorant API. Works right out of the box!
Stars: ✭ 84 (+154.55%)
Mutual labels:  requests, api-wrapper
mtgjson-website
MTGJSON Documentation Front-End Application built with Vuepress 1
Stars: ✭ 29 (-12.12%)
Mutual labels:  magic, mtg
Snug
Write reusable web API interactions
Stars: ✭ 108 (+227.27%)
Mutual labels:  requests, api-wrapper
Scrython
A python wrapper for the Scryfall API
Stars: ✭ 87 (+163.64%)
Mutual labels:  api-wrapper, mtg-api
landlord
Magic: The Gathering mulligan and card draw simulator
Stars: ✭ 16 (-51.52%)
Mutual labels:  magic, mtg
Pyrez
(ON REWRITE) An easy to use (a)sync wrapper for Hi-Rez Studios API (Paladins, Realm Royale, and Smite), written in Python. 🐍
Stars: ✭ 23 (-30.3%)
Mutual labels:  requests, api-wrapper
open route service
An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
Stars: ✭ 20 (-39.39%)
Mutual labels:  api-wrapper, api-rest
ICMP-server
simple web app that use icmp protocol to check some devices if there are up or not
Stars: ✭ 16 (-51.52%)
Mutual labels:  api-rest
tplink-smartplug-api
TP-Link HS1xx smart plug API wrapper.
Stars: ✭ 48 (+45.45%)
Mutual labels:  api-wrapper
pokemon-icons
Fan art inspired by Pokémon
Stars: ✭ 85 (+157.58%)
Mutual labels:  pokemon
Deep-learning-model-deploy-with-django
Serving a keras model (neural networks) in a website with the python Django-REST framework.
Stars: ✭ 76 (+130.3%)
Mutual labels:  api-rest
dubbo-go-pixiu
Based on the proxy gateway service of dubbo-go, it solves the problem that the external protocol calls the internal Dubbo cluster. At present, it supports HTTP and gRPC[developing].
Stars: ✭ 385 (+1066.67%)
Mutual labels:  api-rest
cbapi-python
Carbon Black API - Python language bindings
Stars: ✭ 140 (+324.24%)
Mutual labels:  api-wrapper
resto
🔗 a CLI app can send pretty HTTP & API requests with TUI
Stars: ✭ 113 (+242.42%)
Mutual labels:  requests
usim800
usim800 is a Python driver module for SIM800 GSM/GPRS .
Stars: ✭ 36 (+9.09%)
Mutual labels:  requests
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-66.67%)
Mutual labels:  api-wrapper
graphql-pokemon
Extensive Pokémon GraphQL API
Stars: ✭ 81 (+145.45%)
Mutual labels:  pokemon

Magic Kard Market Python SDK

https://badge.fury.io/py/mkmsdk.png https://readthedocs.org/projects/mkm-sdk/badge/?version=latest

A simple SDK for dedicated and widget apps working with Magic Kard Market.

Contributing

Feel free to contribute! Submit a PR following the guidelines and it will be alright.

Requirements

Setup

From the command line:

pip install mkmsdk

For the SDK to work properly you need to create four environment variables holding the tokens necessary to create the authorization to make requests. You can find them in your Magic Kard Market account page under the apps section.

  • MKM_APP_TOKEN
  • MKM_APP_SECRET
  • MKM_ACCESS_TOKEN
  • MKM_ACCESS_TOKEN_SECRET

MKM_ACCESS_TOKEN and MKM_ACCESS_TOKEN_SECRET need to be set to empty string if you want to use a widget app.

Usage

First thing to do is import the Mkm class and the API map:

from mkmsdk.mkm import Mkm
from mkmsdk.api_map import _API_MAP

Instance a new instance of Mkm:

# Using API v1.1
mkm = Mkm(_API_MAP["1.1"]["api"], _API_MAP["1.1"]["api_root"])
# Using API v2.0
mkm = Mkm(_API_MAP["2.0"]["api"], _API_MAP["2.0"]["api_root"])

If you want to test on Magic Card Market's sandbox you must use the sandbox root endpoint:

mkm_sandbox = Mkm(_API_MAP["2.0"]["api"], _API_MAP["2.0"]["api_sandbox_root"])

To make a request:

response = mkm.account_management.account()

# Formats an endpoint
response = mkm.market_place.user(user='SampleUser')

# Call endpoint with specified parameters
response = mkm.account_management.vacation(params={"onVacation": "false"})

This will return a Response object that contains the response from the server.

Note that only market_place requests work when using a widget app.

To get a json you can call response.json().

Tests

Integration tests will be skipped if the four environment variables are not set.

  • MKM_APP_TOKEN
  • MKM_APP_SECRET
  • MKM_ACCESS_TOKEN
  • MKM_ACCESS_TOKEN_SECRET

Note that some tests will be skipped depending if MKM_ACCESS_TOKEN and MKM_ACCESS_TOKEN_SECRET are empty strings or not.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].