diff --git a/requirements.txt b/requirements.txt index c47b89f..97c7886 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ aiohttp -#Requirements for PyPI +asyncio diff --git a/__init__.py b/scrython/__init__.py similarity index 100% rename from __init__.py rename to scrython/__init__.py diff --git a/cards/__init__.py b/scrython/cards/__init__.py similarity index 100% rename from cards/__init__.py rename to scrython/cards/__init__.py diff --git a/cards/autocomplete.py b/scrython/cards/autocomplete.py similarity index 100% rename from cards/autocomplete.py rename to scrython/cards/autocomplete.py diff --git a/cards/cardid.py b/scrython/cards/cardid.py similarity index 100% rename from cards/cardid.py rename to scrython/cards/cardid.py diff --git a/cards/collector.py b/scrython/cards/collector.py similarity index 100% rename from cards/collector.py rename to scrython/cards/collector.py diff --git a/cards/mtgo.py b/scrython/cards/mtgo.py similarity index 100% rename from cards/mtgo.py rename to scrython/cards/mtgo.py diff --git a/cards/multiverse.py b/scrython/cards/multiverse.py similarity index 100% rename from cards/multiverse.py rename to scrython/cards/multiverse.py diff --git a/cards/named.py b/scrython/cards/named.py similarity index 100% rename from cards/named.py rename to scrython/cards/named.py diff --git a/cards/randomcard.py b/scrython/cards/randomcard.py similarity index 100% rename from cards/randomcard.py rename to scrython/cards/randomcard.py diff --git a/cards/scryfall_object.py b/scrython/cards/scryfall_object.py similarity index 100% rename from cards/scryfall_object.py rename to scrython/cards/scryfall_object.py diff --git a/docs/Cards.md b/scrython/docs/Cards.md similarity index 100% rename from docs/Cards.md rename to scrython/docs/Cards.md diff --git a/docs/Cards_Classes.md b/scrython/docs/Cards_Classes.md similarity index 100% rename from docs/Cards_Classes.md rename to scrython/docs/Cards_Classes.md diff --git a/scrython/docs/Rulings.md b/scrython/docs/Rulings.md new file mode 100644 index 0000000..a2fd5ff --- /dev/null +++ b/scrython/docs/Rulings.md @@ -0,0 +1,26 @@ +# Rulings + +Documentation for a rulings object. These docs will likely not be as detailed as the official Scryfall Documentation, and you should reference that for more information. + +>In the event that a key isn't found or has been changed, you can access the full JSON output with the `scryfallJson` variable (`card.scryfallJson`). + +## Attributes +All attributes are listed assuming the following +`rule = scrython.rulings.()` is the current usage. + +|Name|Data type returned|Description| +|:---:|:---:|:---:| +|`object()`|String|Returns the type of object it is. (card, error, etc)| +|`had_more()`|Bool| If true, this ruling object has more rules than it currently displays.| +|`data()`|List|A list of ruling objects. +|`data_length()`|Integer|The length of the `data` list.| +|`ruling_object()`|String|The type of object for a given ruling. Requires an integer as a parameter, which acts as a tuple.| +|`ruling_source()`|String|The source of the ruling. Requires an integer as a parameter, which acts as a tuple.| +|`ruling_published_at()`|String|The date when the ruling was published. Requires an integer as a parameter, which acts as a tuple.| +|`ruling_comment()`|String|The effective ruling. Requires an integer as a parameter, which acts as a tuple.| + +Example usage: + + rule = scrython.rulings.Id(id="0f91d225-788e-42fc-9d01-8668f672b717") + rule.ruling_comment(5) + >>>"If you control multiple As Foretolds, you may cast one spell for each of them paying {0}." diff --git a/scrython/docs/Rulings_Classes.md b/scrython/docs/Rulings_Classes.md new file mode 100644 index 0000000..1bd564d --- /dev/null +++ b/scrython/docs/Rulings_Classes.md @@ -0,0 +1,66 @@ +# Rulings Classes + +## `rulings.Id()` +Gets the ruling of a card by the Scryfall Id. + +**Parameters:** + +| Param |Required [y/n]| Input type | Description | +| :---: | :---: | :---: |:---: | +|id|Yes|String|The id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + + rule = scrython.rulings.Id(id='31412335-110c-449a-9c2f-bff8763a6504') + +## `rulings.Mtgo()` +Gets the ruling of a card by the Mtgo Id. + +**Parameters:** + +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|id|Yes|String|The Mtgo id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + + rule = scrython.rulings.Mtgo(id="24811") + +## `rulings.Multiverse()` +Gets the ruling of a card by the Multiverse Id. + +**Parameters:** + +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|id|Yes|String|The Multiverse Id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + + rule = scrython.rulings.Multiverse(id="124451") + +## `rulings.Code()` +Gets the ruling of a card by the set code and collector number. + +**Parameters:** + +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|code|Yes|String|The 3 letter set code of the card.| +|collector_number|Yes|String|The collector number of the card.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + + rule = scrython.rulings.Code(code='CSP', collector_number='142') diff --git a/rulings/__init__.py b/scrython/rulings/__init__.py similarity index 100% rename from rulings/__init__.py rename to scrython/rulings/__init__.py diff --git a/rulings/mtgo.py b/scrython/rulings/mtgo.py similarity index 100% rename from rulings/mtgo.py rename to scrython/rulings/mtgo.py diff --git a/rulings/multiverse_id.py b/scrython/rulings/multiverse_id.py similarity index 100% rename from rulings/multiverse_id.py rename to scrython/rulings/multiverse_id.py diff --git a/rulings/rulings_object.py b/scrython/rulings/rulings_object.py similarity index 100% rename from rulings/rulings_object.py rename to scrython/rulings/rulings_object.py diff --git a/rulings/scryfall_id.py b/scrython/rulings/scryfall_id.py similarity index 100% rename from rulings/scryfall_id.py rename to scrython/rulings/scryfall_id.py diff --git a/rulings/set_code.py b/scrython/rulings/set_code.py similarity index 100% rename from rulings/set_code.py rename to scrython/rulings/set_code.py diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b88034e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md diff --git a/setup.py b/setup.py index 4c1ecc5..e9f6d29 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,24 @@ -from distutils.core import setup +from setuptools import setup + +requirements = [] +with open('requirements.txt') as f: + requirements = f.read().splitlines() + +readme = '' +with open('README.md') as f: + readme = f.read() setup( name='scrython', - packages=['scrython'] + packages=['scrython'], version='0.1.0', description='A wrapper for using the Scryfall API.', + long_description=readme url='https://github.com/NandaScott/Scrython', download_url='https://github.com/NandaScott/Scrython/archive/0.1.0.tar.gz', author='Nanda Scott', + author_email='nanda1123@gmail.com', license='MIT', - keywords=['Scryfall', 'magic', 'the gathering', 'scrython', 'wrapper'] + keywords=['Scryfall', 'magic', 'the gathering', 'scrython', 'wrapper'], + install_requires=requirements )