| Name | pygo-API JSON |
| Version |
0.1.2
JSON |
| download |
| home_page | https://github.com/Yeet195/pygo_API |
| Summary | A simple tool to utilize the YGOProDeck API as a Python module |
| upload_time | 2024-08-08 07:44:02 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | None |
| license | MIT |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# pygo_API
Python Module to access the YGOProDeck API
## Instalation
```shell
pip install pygo-API
```
## YGOProDeck Params and API queries
API queries:
|query|usage|params|
|---|---|---|
|name|get card by string|string|
|archetype|get cards of specific archetype|string|
|level|get cards of specific level|int|
|atribute|get cards of specific atribute|string|
|banlist|only returns if card is on chosen banlist|string|
|cardset|get cards from declared set|string|
|fname|search card by partial name|string|
|race|get cards of specific attribute|string|
|format|get cards from chosen fromat|string|
|linkmarker|filter by link markers|string|
|misc|add YGOProDeck specific data to JSON dict|yes|
|staple|show cards considered staple|yes|
|startdate|exclude cards relesed before set date|yyyy-mm-dd|
|enddate|exclude cards relesed after set date|yyyy-mm-dd|
|type|filter by card type e.g. spell, counter trap|string|
|language|get output in specified language|string|
Params
|type|race|language|
|---|---|---|
|Effect Monster|Aqua|fr|
|Flip Effect Monster|Beast|de|
|Flip Tuner Effect Monster|Beast-Warrior|it|
|Gemini Monster|Creator-God|pt|
|Normal Monster|Cybers||
|Normal Tuner Monster|Dinosaur||
|Pendulum Effect Monster|Divine-Beast||
|Pendulum Effect Ritual Monster|Dragon||
|Pendulum Flip Effect Monster|Fairy||
|Pendulum Normal Monster|Fiend||
|Pendulum Tuner Effect Monster|Fish||
|Ritual Effect Monster|Insect||
|Ritual Monster|Machine||
|Spell Card|Plant||
|Spirit Monster|Psychic||
|Toon Monster|Pyro||
|Trap Card|Reptile||
|Tuner Monster|Rock||
|Union Effect Monster|Sea Serpent||
|Fusion Monster|Spellcaster||
|Link Monster|Thunder||
|Pendulum Effect Fusion Monster|Warrior||
|Synchro Monster|Winged Beast||
|Synchro Pendulum Effect Monster|Wyrm||
|Synchro Tuner Monster|Zombie||
|XYZ Monster|Normal||
|XYZ Pendulum Effect Monster|Field||
|Skill Card|Equip||
|Token|Continuous||
||Quick-Play||
||Ritual||
||Normal||
||Continuous||
||Counter||
## Usage
```python
import pygo_API
```
use to include the module
```python
image = pygo_API.Image("normal", "kuriboh").getImage()
```
Saves the image of "Kuriboh" in the variable image as well as caching it.
```python
print(pygo_API.Card(name="kuriboh").getData())
```
Prints the entire data of "kuriboh".
```python
print(pygo_API.Card().random())
```
prints a random card dict
## Examples
### Get All Cards
```python
tcg = pygo_API.Card().getData()
print(tcg)
```
**Warning**: The output is a JSON dict with roughly 670,000 lines, so be careful with generic API requests.
### Get Specific Link Monsters
```python
dragons = pygo_API.Card(fname="dragon", linkmarker="bottom,top,left").getData()
```
Saves all Linkmonsters with "dragon" in their name and Linkarrows pointing to the bottom, top and left to the "dragons" variable.
### Get All Staple Cards
```python
staples = pygo_API.Card(staple="yes").getData()
print(staples)
```
Prints every card considered a staple by YGOProDeck
### Get Cards from TCG Banlist within a Date Range
```python
tcg = pygo_API.Card(banlist="tcg", startdate="2020-01-01", enddate="2024-01-01").getData()
```
Get all cards added to the tcg banlist between first of january 2020 and the first of january 2024
### Search then sort cards by name
```python
tcg = pygo_API.Card(fname="snake-eye", sort="name").getData(fields=["name", "id"])
print(tcg)
```
Print all "snake-eye" cards sortet by name and only show their name and id.
### Get Card Text
```python
print(pygo_API.Card(name="kuriboh").getData(fields=["desc"]))
```
Print out the card text of kuriboh
### Caching
Every API request is cached for the duration of the program or script.
Alternatavly you can use:
```python
pygo_API.Cache().clear_cache()
```
to clear the cache mid code.
The cachfile is stored as the URL encrypted to SHA-256
## Method arguments
### Filter Returned Data
```python
.getData(fields=["name"])
```
The "fields" argument takes only arrays as input and then lets the method return only the keys of that name.
### Sort Output
```python
pygo_API.Card(sort="name")
```
The "sort" argument sorts your output from A-Z with the given dict key.
### Save Image locally
```python
pygo_API.Image(save=True)
```
If the "save" argument is set to "True" the method will save the Image in a local directory as a .jpg file.
Raw data
{
"_id": null,
"home_page": "https://github.com/Yeet195/pygo_API",
"name": "pygo-API",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8e/6e/cf92950534a0b61110c6be2f81a6912c6101f9dc83d89629b96cd8bb5302/pygo_api-0.1.2.tar.gz",
"platform": null,
"description": "# pygo_API\r\n\r\nPython Module to access the YGOProDeck API\r\n\r\n## Instalation\r\n\r\n```shell\r\npip install pygo-API\r\n```\r\n\r\n## YGOProDeck Params and API queries\r\n\r\nAPI queries:\r\n\r\n|query|usage|params|\r\n|---|---|---|\r\n|name|get card by string|string|\r\n|archetype|get cards of specific archetype|string|\r\n|level|get cards of specific level|int|\r\n|atribute|get cards of specific atribute|string|\r\n|banlist|only returns if card is on chosen banlist|string|\r\n|cardset|get cards from declared set|string|\r\n|fname|search card by partial name|string|\r\n|race|get cards of specific attribute|string|\r\n|format|get cards from chosen fromat|string|\r\n|linkmarker|filter by link markers|string|\r\n|misc|add YGOProDeck specific data to JSON dict|yes|\r\n|staple|show cards considered staple|yes|\r\n|startdate|exclude cards relesed before set date|yyyy-mm-dd|\r\n|enddate|exclude cards relesed after set date|yyyy-mm-dd|\r\n|type|filter by card type e.g. spell, counter trap|string|\r\n|language|get output in specified language|string|\r\n\r\nParams\r\n\r\n|type|race|language|\r\n|---|---|---|\r\n|Effect Monster|Aqua|fr|\r\n|Flip Effect Monster|Beast|de|\r\n|Flip Tuner Effect Monster|Beast-Warrior|it|\r\n|Gemini Monster|Creator-God|pt|\r\n|Normal Monster|Cybers||\r\n|Normal Tuner Monster|Dinosaur||\r\n|Pendulum Effect Monster|Divine-Beast||\r\n|Pendulum Effect Ritual Monster|Dragon||\r\n|Pendulum Flip Effect Monster|Fairy||\r\n|Pendulum Normal Monster|Fiend||\r\n|Pendulum Tuner Effect Monster|Fish||\r\n|Ritual Effect Monster|Insect||\r\n|Ritual Monster|Machine||\r\n|Spell Card|Plant||\r\n|Spirit Monster|Psychic||\r\n|Toon Monster|Pyro||\r\n|Trap Card|Reptile||\r\n|Tuner Monster|Rock||\r\n|Union Effect Monster|Sea Serpent||\r\n|Fusion Monster|Spellcaster||\r\n|Link Monster|Thunder||\r\n|Pendulum Effect Fusion Monster|Warrior||\r\n|Synchro Monster|Winged Beast||\r\n|Synchro Pendulum Effect Monster|Wyrm||\r\n|Synchro Tuner Monster|Zombie||\r\n|XYZ Monster|Normal||\r\n|XYZ Pendulum Effect Monster|Field||\r\n|Skill Card|Equip||\r\n|Token|Continuous||\r\n||Quick-Play||\r\n||Ritual||\r\n||Normal||\r\n||Continuous||\r\n||Counter||\r\n\r\n## Usage\r\n\r\n```python\r\nimport pygo_API\r\n```\r\n\r\nuse to include the module\r\n\r\n```python\r\nimage = pygo_API.Image(\"normal\", \"kuriboh\").getImage()\r\n```\r\n\r\nSaves the image of \"Kuriboh\" in the variable image as well as caching it.\r\n\r\n```python\r\nprint(pygo_API.Card(name=\"kuriboh\").getData())\r\n```\r\n\r\nPrints the entire data of \"kuriboh\".\r\n\r\n```python\r\nprint(pygo_API.Card().random())\r\n```\r\n\r\nprints a random card dict\r\n\r\n## Examples\r\n\r\n### Get All Cards\r\n\r\n```python\r\ntcg = pygo_API.Card().getData()\r\n\r\nprint(tcg)\r\n```\r\n\r\n**Warning**: The output is a JSON dict with roughly 670,000 lines, so be careful with generic API requests.\r\n\r\n### Get Specific Link Monsters\r\n\r\n```python\r\ndragons = pygo_API.Card(fname=\"dragon\", linkmarker=\"bottom,top,left\").getData()\r\n```\r\n\r\nSaves all Linkmonsters with \"dragon\" in their name and Linkarrows pointing to the bottom, top and left to the \"dragons\" variable.\r\n\r\n### Get All Staple Cards\r\n\r\n```python\r\nstaples = pygo_API.Card(staple=\"yes\").getData()\r\n\r\nprint(staples)\r\n```\r\n\r\nPrints every card considered a staple by YGOProDeck\r\n\r\n### Get Cards from TCG Banlist within a Date Range\r\n\r\n```python\r\ntcg = pygo_API.Card(banlist=\"tcg\", startdate=\"2020-01-01\", enddate=\"2024-01-01\").getData()\r\n```\r\n\r\nGet all cards added to the tcg banlist between first of january 2020 and the first of january 2024\r\n\r\n### Search then sort cards by name\r\n\r\n```python\r\ntcg = pygo_API.Card(fname=\"snake-eye\", sort=\"name\").getData(fields=[\"name\", \"id\"])\r\n\r\nprint(tcg)\r\n```\r\n\r\nPrint all \"snake-eye\" cards sortet by name and only show their name and id.\r\n\r\n### Get Card Text\r\n\r\n```python\r\nprint(pygo_API.Card(name=\"kuriboh\").getData(fields=[\"desc\"]))\r\n```\r\n\r\nPrint out the card text of kuriboh\r\n\r\n### Caching\r\n\r\nEvery API request is cached for the duration of the program or script.\r\n\r\nAlternatavly you can use:\r\n\r\n```python\r\npygo_API.Cache().clear_cache()\r\n```\r\n\r\nto clear the cache mid code.\r\n\r\nThe cachfile is stored as the URL encrypted to SHA-256\r\n\r\n## Method arguments\r\n\r\n### Filter Returned Data\r\n\r\n```python\r\n.getData(fields=[\"name\"])\r\n```\r\n\r\nThe \"fields\" argument takes only arrays as input and then lets the method return only the keys of that name.\r\n\r\n### Sort Output\r\n\r\n```python\r\npygo_API.Card(sort=\"name\")\r\n```\r\n\r\nThe \"sort\" argument sorts your output from A-Z with the given dict key.\r\n\r\n### Save Image locally\r\n\r\n```python\r\npygo_API.Image(save=True)\r\n```\r\n\r\nIf the \"save\" argument is set to \"True\" the method will save the Image in a local directory as a .jpg file.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple tool to utilize the YGOProDeck API as a Python module",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/Yeet195/pygo_API"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "49ab1c053abaae95e945b80d6bc39b7662c25b51c5b6d23385aec3fc9f4ec42e",
"md5": "2b174e8658b7d9ef4adeaa53b18533a6",
"sha256": "8e87be4c9077e54fc0905e4094d5f97ff6d82683d3009944bf93280d286f8db4"
},
"downloads": -1,
"filename": "pygo_API-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2b174e8658b7d9ef4adeaa53b18533a6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9985,
"upload_time": "2024-08-08T07:44:00",
"upload_time_iso_8601": "2024-08-08T07:44:00.787342Z",
"url": "https://files.pythonhosted.org/packages/49/ab/1c053abaae95e945b80d6bc39b7662c25b51c5b6d23385aec3fc9f4ec42e/pygo_API-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8e6ecf92950534a0b61110c6be2f81a6912c6101f9dc83d89629b96cd8bb5302",
"md5": "453b6cddef03805cf0862c90a5316923",
"sha256": "b7ae5e39255053b7a0b47c370f29db144b0b4e77a09d4cdee9b815a6bb8880dc"
},
"downloads": -1,
"filename": "pygo_api-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "453b6cddef03805cf0862c90a5316923",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8483,
"upload_time": "2024-08-08T07:44:02",
"upload_time_iso_8601": "2024-08-08T07:44:02.571690Z",
"url": "https://files.pythonhosted.org/packages/8e/6e/cf92950534a0b61110c6be2f81a6912c6101f9dc83d89629b96cd8bb5302/pygo_api-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-08 07:44:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Yeet195",
"github_project": "pygo_API",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pygo-api"
}