forked from PokemonTCG/pokemon-tcg-sdk-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ca2f365
Showing
6 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
presets: ["es2015"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
# Magic: The Gathering SDK | ||
|
||
[![PyPI version](https://badge.fury.io/py/mtgsdk.svg)](https://badge.fury.io/py/mtgsdk) | ||
[![Build Status](https://travis-ci.org/MagicTheGathering/mtg-sdk-python.svg?branch=master)](https://travis-ci.org/MagicTheGathering/mtg-sdk-python) | ||
[![Requirements Status](https://requires.io/github/MagicTheGathering/mtg-sdk-python/requirements.svg?branch=master)](https://requires.io/github/MagicTheGathering/mtg-sdk-python/requirements/?branch=master) | ||
[![Code Climate](https://codeclimate.com/github/MagicTheGathering/mtg-sdk-python/badges/gpa.svg)](https://codeclimate.com/github/MagicTheGathering/mtg-sdk-python) | ||
[![Coverage Status](https://coveralls.io/repos/github/MagicTheGathering/mtg-sdk-python/badge.svg?branch=master)](https://coveralls.io/github/MagicTheGathering/mtg-sdk-python?branch=master) | ||
|
||
This is the Magic: The Gathering SDK Python implementation. It is a wrapper around the MTG API of [magicthegathering.io](http://magicthegathering.io/). | ||
|
||
## Requirements | ||
Python 3 is currently the only supported version for the sdk. More specifically, the package was developed using Python 3.4. | ||
|
||
## Installation | ||
|
||
Using pip: | ||
|
||
pip install mtgsdk | ||
|
||
## Usage | ||
|
||
Import (Card and Set will be most used) | ||
|
||
from mtgsdk import Card | ||
from mtgsdk import Set | ||
from mtgsdk import Type | ||
from mtgsdk import Supertype | ||
from mtgsdk import Subtype | ||
from mtgsdk import Changelog | ||
|
||
### Properties Per Class | ||
|
||
#### Card | ||
|
||
name | ||
multiverse_id | ||
layout | ||
names | ||
mana_cost | ||
cmc | ||
colors | ||
type | ||
supertypes | ||
subtypes | ||
rarity | ||
text | ||
flavor | ||
artist | ||
number | ||
power | ||
toughness | ||
loyalty | ||
variations | ||
watermark | ||
border | ||
timeshifted | ||
hand | ||
life | ||
reserved | ||
release_date | ||
starter | ||
rulings | ||
foreign_names | ||
printings | ||
original_text | ||
original_type | ||
legalities | ||
source | ||
image_url | ||
set | ||
id | ||
|
||
#### Set | ||
|
||
code | ||
name | ||
gatherer_code | ||
old_code | ||
magic_cards_info_code | ||
release_date | ||
border | ||
type | ||
block | ||
online_only | ||
booster | ||
mkm_id | ||
mkm_name | ||
|
||
#### Changelog | ||
|
||
version | ||
release_date | ||
details | ||
|
||
### Find Card by Multiverse Id | ||
|
||
card = Card.find(386616) | ||
|
||
### Filter Cards via Query Parameters | ||
|
||
cards = Card.where(set='ktk').where(subtypes='warrior,human').all() | ||
|
||
### Get all cards (will page through all the data - could take awhile) | ||
|
||
cards = Card.all() | ||
|
||
### Get all cards, but only a specific page of data | ||
|
||
cards = Card.where(page=5).where(pageSize=1000).all() | ||
|
||
### Find a Set by code | ||
|
||
set = Set.find('ktk') | ||
|
||
### Get all sets | ||
|
||
sets = Set.all() | ||
|
||
### Filter sets via query parameters | ||
|
||
sets = Set.where(name='khans').all() | ||
|
||
### Get all types | ||
|
||
types = Type.all() | ||
|
||
### Get all subtypes | ||
|
||
subtypes = Subtype.all() | ||
|
||
### Get all supertypes | ||
|
||
supertypes = Supertype.all() | ||
|
||
### Get all changelogs | ||
|
||
changelogs = Changelog.all() | ||
|
||
## Contributing | ||
|
||
1. Fork it ( https://github.com/[my-github-username]/mtg-sdk-python/fork ) | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create a new Pull Request |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "mtg-sdk-javascript", | ||
"version": "0.1.0", | ||
"description": "Magic: The Gathering SDK is a javascript wrapper around the MTG API located at magicthegathering.io", | ||
"private": true, | ||
"author": { | ||
"name": "Raine Revere", | ||
"email": "[email protected]", | ||
"url": "https://github.com/metaraine" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel-cli": "^6.8.0", | ||
"babel-preset-es2015": "^6.6.0", | ||
"chai": "^3.5.0", | ||
"chai-as-promised": "^5.3.0", | ||
"mocha": "^2.4.5" | ||
} | ||
} |