nintendeals


Namenintendeals JSON
Version 3.1.3 PyPI version JSON
download
home_pagehttps://github.com/fedecalendino/nintendeals
SummaryScraping tools for Nintendo Switch games and prices on NA, EU and JP.
upload_time2024-09-28 12:14:09
maintainerNone
docs_urlNone
authorFede Calendino
requires_python<4.0,>=3.8
licenseMIT
keywords nintendo deals
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
             # nintendeals
> "nintendeals was a bot, he loved learning and deals on nintendo's eshop." **LetsFunHans** 💬️

[![Version](https://img.shields.io/pypi/v/nintendeals?logo=pypi)](https://pypi.org/project/nintendeals)
[![Quality Gate Status](https://img.shields.io/sonar/alert_status/fedecalendino_nintendeals?logo=sonarcloud&server=https://sonarcloud.io)](https://sonarcloud.io/dashboard?id=fedecalendino_nintendeals)
[![CodeCoverage](https://img.shields.io/sonar/coverage/fedecalendino_nintendeals?logo=sonarcloud&server=https://sonarcloud.io)](https://sonarcloud.io/dashboard?id=fedecalendino_nintendeals)

-----

Named after the my old [reddit bot](https://reddit.com/u/nintendeals), nintendeals is now a library with 
all the scrapers and integrations of nintendo services that I used.


## Terminology

Before getting into any details first we need too get into the same page with a few terms:

### Region

Here we have three regions NA, EU and JP each one corresponding to Nintendo of America (NoA), Nintendo of Europe (NoE)
and Nintendo of Japan (NoJ). Each of these regions have set of countries they are "in charge of":

NoA:
  * Canada
  * Mexico
  * United Stated
  
NoE:
  * Every country in the European Union
  * Australia
  * New Zealand
  * South Africa
  
NoJ:
  * Japan
  
### nsuid

An nsuid is a 14 digit long string which Nintendo uses to identify games on each region. 
Taking Breath of the Wild as an example, we have these 3 nsuids for it (one per region):

```    
  * 70010000000025 (NA)
  * 70010000000023 (EU)
  * 70010000000026 (JP)
```
    
### Product Code

The product code is another type of ID that Nintendo uses, it usually is a 8/9 character long string.
Taking Splatoon 2 as an example, we have these 3 product codes for it (one per region):

```
  * HACPAAB6B (NA)
  * HACPAAB6C (EU)
  *  HACAAB6A (JP)
```

The difference with the nsuid is that the product code has a constant between all regions (`AAB6` in this example), 
and this is what I decided to call [unique_id](https://github.com/fedecalendino/nintendeals/blob/master/nintendeals/commons/classes/games.py#L56) 
and it is what we can you to join a game across all regions.

You can also see this code in the front of your Nintendo Switch [cartridge](https://media.karousell.com/media/photos/products/2019/08/17/splatoon_2_cartridge_only_1566040350_4f38e061_progressive.jpg).

## Services

This library provides three types of services: Info, Listing, Searching and Pricing. Each region has a different 
version of Info, Listing and Searching, but Pricing is the same for all as it only requires a country and an nsuid.

### Listing

Even thought there are different version for each region, they all work in the same way. Given a supported 
platform ([for this library](https://github.com/fedecalendino/nintendeals/blob/master/nintendeals/constants.py#L15))
they will retrieve a list games in the selected region (in the form of an iterator).

```python
from nintendeals import noa

for game in noa.list_switch_games():
    print(game.title, "/", game.nsuid)
```

```text
>> ARMS / 70010000000392
>> Astro Duel Deluxe / 70010000000301
>> Axiom Verge / 70010000000821
>> Azure Striker GUNVOLT: STRIKER PACK / 70010000000645
>> Beach Buggy Racing / 70010000000721
```

```python
from nintendeals import noe

for game in noe.list_switch_games():
    print(game.title, "/", game.nsuid)
```

```text
>> I and Me / 70010000000314
>> In Between / 70010000009184
>> Ghost 1.0 / 70010000001386
>> Resident Evil 0 / 70010000012848
>> 64.0 / 70010000020867
```

### Searching

Built on top of the listing services, these provide a simple way to search for games by title or release_date:

```python
from nintendeals import noa

for game in noa.search_switch_games(query="Zelda"):
    print(game.title, "/", game.nsuid)
```

```text
>> The Legend of Zelda™: Link’s Awakening / 70010000020033
>> The Legend of Zelda™: Link's Awakening: Dreamer Edition / None
>> Cadence of Hyrule: Crypt of the NecroDancer Featuring The Legend of Zelda / 70010000021364
>> The Legend of Zelda™: Breath of the Wild / 70010000000025
```


### Info

Once you have the nsuid of the game that you want, you can call the `game_info` service. And again, each region has their
own version but they all work the same, but keep in mind that you need to use the correct nsuid for each region.
Coming back to the nsuid of Breath of the Wild as an example:

```python
from nintendeals import noa

game = noa.game_info("70010000000025")
print(game.title)
print(game.product_code, game.unique_id)
print(game.release_date)
print(game.players)
print(str(game.rating[0]), game.rating[1])
print(game.eshop.ca_fr)

for feature, value in game.features.items():
    print(" *", str(feature), ":", value)
```

```text
>> The Legend of Zelda™: Breath of the Wild
>> HACPAAAAA AAAA
>> 2017-03-03 00:00:00
>> 1
>> ESRB Everyone 10+
>> https://www.nintendo.com/fr_CA/games/detail/the-legend-of-zelda-breath-of-the-wild-switch
>>  * Demo Available : False
>>  * DLC Available : False
>>  * Nintendo Switch Online Required : True
>>  * Save Data Cloud Supported : True
```

```python
from nintendeals import noe

game = noe.game_info("70010000000023")
print(game.title)
print(game.product_code, game.unique_id)
print(game.release_date)
print(game.players)
print(str(game.rating[0]), game.rating[1])
print(game.eshop.uk_en)

for feature, value in game.features.items():
    print(" *", str(feature), ":", value)
```

```text
>> The Legend of Zelda: Breath of the Wild
>> HACPAAAAA AAAA
>> 2017-03-03 00:00:00
>> 1
>> PEGI 12
>> https://www.nintendo.co.uk/Games/Nintendo-Switch/The-Legend-of-Zelda-Breath-of-the-Wild-1173609.html
>>  * Amiibo Supported : True
>>  * Demo Available : False
>>  * DLC Available : False
>>  * Nintendo Switch Online Required : False
>>  * Save Data Cloud Supported : True
>>  * Voice Chat Supported : False
```

```python
from nintendeals import noj

game = noj.game_info("70010000000026")
print(game.title)
print(game.product_code, game.unique_id)
print(game.release_date)
print(game.players)
print(str(game.rating[0]), game.rating[1])
print(game.eshop.jp_jp)

for feature, value in game.features.items():
    print(" *", str(feature), ":", value)
```

```text
>> ゼルダの伝説 ブレス オブ ザ ワイルド
>> HACAAAAA AAAA
>> 2017-03-03 00:00:00
>> 1
>> CERO B
>> https://store-jp.nintendo.com/list/software/70010000000026.html
>>  * Amiibo Supported : True
>>  * DLC Available : True
>>  * Nintendo Switch Online Required : False
```


### Pricing

Given a country code (using the alpha-2 iso standard) and a game or list of games this service will fetch the current 
pricing of that/those games for that country. Since this service uses nsuids to fetch the price, make sure that the
games that you provide have the regional nsuid that matches the country that you want. For example, only the nsuid for
the American region will be able to fetch you the prices of Canada, Mexico and United Stated but not for Japan or Spain.

```python
from nintendeals import noe
from nintendeals.api import prices

game = noe.game_info("70010000007705")
print(game.title)
print()

price = prices.get_price(game, country="CZ")  # Czech Republic
print(price.currency)
print(price.value)
print(price.sale_discount, "%")
print(price.sale_value)
print(price.sale_start)
print(price.sale_end)

# Alternatively you can do this for the same effect:
price = game.price(country="CZ") 
``` 

```text
Dead Cells

CZK
625.0
80 %
500.0
2020-04-19 22:00:00
2020-05-03 21:59:59
```

To reduce the amount of call to the prices api, you can also use the `get_prices` service that works in a similar way
but it expects a list of games instead of only one:

```python
from nintendeals import noa
from nintendeals.api import prices

botw = noa.game_info("70010000000025")
print(botw.title)
celeste = noa.game_info("70010000006442")
print(celeste.title)

print()

prices = prices.get_prices([botw, celeste], country="US")
for nsuid, price in prices:
    print(nsuid)
    print(price.value)
    print(price.sale_value)
    print()
```

```text
The Legend of Zelda™: Breath of the Wild
Celeste

70010000000025
59.99
None

70010000006442
19.99
4.99
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fedecalendino/nintendeals",
    "name": "nintendeals",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "nintendo, deals",
    "author": "Fede Calendino",
    "author_email": "fede@calendino.com",
    "download_url": "https://files.pythonhosted.org/packages/28/70/634b517a8856f0153146b9013b3297a4afc336d018b4c1d73beaa5c70e70/nintendeals-3.1.3.tar.gz",
    "platform": null,
    "description": " # nintendeals\n> \"nintendeals was a bot, he loved learning and deals on nintendo's eshop.\" **LetsFunHans** \ud83d\udcac\ufe0f\n\n[![Version](https://img.shields.io/pypi/v/nintendeals?logo=pypi)](https://pypi.org/project/nintendeals)\n[![Quality Gate Status](https://img.shields.io/sonar/alert_status/fedecalendino_nintendeals?logo=sonarcloud&server=https://sonarcloud.io)](https://sonarcloud.io/dashboard?id=fedecalendino_nintendeals)\n[![CodeCoverage](https://img.shields.io/sonar/coverage/fedecalendino_nintendeals?logo=sonarcloud&server=https://sonarcloud.io)](https://sonarcloud.io/dashboard?id=fedecalendino_nintendeals)\n\n-----\n\nNamed after the my old [reddit bot](https://reddit.com/u/nintendeals), nintendeals is now a library with \nall the scrapers and integrations of nintendo services that I used.\n\n\n## Terminology\n\nBefore getting into any details first we need too get into the same page with a few terms:\n\n### Region\n\nHere we have three regions NA, EU and JP each one corresponding to Nintendo of America (NoA), Nintendo of Europe (NoE)\nand Nintendo of Japan (NoJ). Each of these regions have set of countries they are \"in charge of\":\n\nNoA:\n  * Canada\n  * Mexico\n  * United Stated\n  \nNoE:\n  * Every country in the European Union\n  * Australia\n  * New Zealand\n  * South Africa\n  \nNoJ:\n  * Japan\n  \n### nsuid\n\nAn nsuid is a 14 digit long string which Nintendo uses to identify games on each region. \nTaking Breath of the Wild as an example, we have these 3 nsuids for it (one per region):\n\n```    \n  * 70010000000025 (NA)\n  * 70010000000023 (EU)\n  * 70010000000026 (JP)\n```\n    \n### Product Code\n\nThe product code is another type of ID that Nintendo uses, it usually is a 8/9 character long string.\nTaking Splatoon 2 as an example, we have these 3 product codes for it (one per region):\n\n```\n  * HACPAAB6B (NA)\n  * HACPAAB6C (EU)\n  *  HACAAB6A (JP)\n```\n\nThe difference with the nsuid is that the product code has a constant between all regions (`AAB6` in this example), \nand this is what I decided to call [unique_id](https://github.com/fedecalendino/nintendeals/blob/master/nintendeals/commons/classes/games.py#L56) \nand it is what we can you to join a game across all regions.\n\nYou can also see this code in the front of your Nintendo Switch [cartridge](https://media.karousell.com/media/photos/products/2019/08/17/splatoon_2_cartridge_only_1566040350_4f38e061_progressive.jpg).\n\n## Services\n\nThis library provides three types of services: Info, Listing, Searching and Pricing. Each region has a different \nversion of Info, Listing and Searching, but Pricing is the same for all as it only requires a country and an nsuid.\n\n### Listing\n\nEven thought there are different version for each region, they all work in the same way. Given a supported \nplatform ([for this library](https://github.com/fedecalendino/nintendeals/blob/master/nintendeals/constants.py#L15))\nthey will retrieve a list games in the selected region (in the form of an iterator).\n\n```python\nfrom nintendeals import noa\n\nfor game in noa.list_switch_games():\n    print(game.title, \"/\", game.nsuid)\n```\n\n```text\n>> ARMS / 70010000000392\n>> Astro Duel Deluxe / 70010000000301\n>> Axiom Verge / 70010000000821\n>> Azure Striker GUNVOLT: STRIKER PACK / 70010000000645\n>> Beach Buggy Racing / 70010000000721\n```\n\n```python\nfrom nintendeals import noe\n\nfor game in noe.list_switch_games():\n    print(game.title, \"/\", game.nsuid)\n```\n\n```text\n>> I and Me / 70010000000314\n>> In Between / 70010000009184\n>> Ghost 1.0 / 70010000001386\n>> Resident Evil 0 / 70010000012848\n>> 64.0 / 70010000020867\n```\n\n### Searching\n\nBuilt on top of the listing services, these provide a simple way to search for games by title or release_date:\n\n```python\nfrom nintendeals import noa\n\nfor game in noa.search_switch_games(query=\"Zelda\"):\n    print(game.title, \"/\", game.nsuid)\n```\n\n```text\n>> The Legend of Zelda\u2122: Link\u2019s Awakening / 70010000020033\n>> The Legend of Zelda\u2122: Link's Awakening: Dreamer Edition / None\n>> Cadence of Hyrule: Crypt of the NecroDancer Featuring The Legend of Zelda / 70010000021364\n>> The Legend of Zelda\u2122: Breath of the Wild / 70010000000025\n```\n\n\n### Info\n\nOnce you have the nsuid of the game that you want, you can call the `game_info` service. And again, each region has their\nown version but they all work the same, but keep in mind that you need to use the correct nsuid for each region.\nComing back to the nsuid of Breath of the Wild as an example:\n\n```python\nfrom nintendeals import noa\n\ngame = noa.game_info(\"70010000000025\")\nprint(game.title)\nprint(game.product_code, game.unique_id)\nprint(game.release_date)\nprint(game.players)\nprint(str(game.rating[0]), game.rating[1])\nprint(game.eshop.ca_fr)\n\nfor feature, value in game.features.items():\n    print(\" *\", str(feature), \":\", value)\n```\n\n```text\n>> The Legend of Zelda\u2122: Breath of the Wild\n>> HACPAAAAA AAAA\n>> 2017-03-03 00:00:00\n>> 1\n>> ESRB Everyone 10+\n>> https://www.nintendo.com/fr_CA/games/detail/the-legend-of-zelda-breath-of-the-wild-switch\n>>  * Demo Available : False\n>>  * DLC Available : False\n>>  * Nintendo Switch Online Required : True\n>>  * Save Data Cloud Supported : True\n```\n\n```python\nfrom nintendeals import noe\n\ngame = noe.game_info(\"70010000000023\")\nprint(game.title)\nprint(game.product_code, game.unique_id)\nprint(game.release_date)\nprint(game.players)\nprint(str(game.rating[0]), game.rating[1])\nprint(game.eshop.uk_en)\n\nfor feature, value in game.features.items():\n    print(\" *\", str(feature), \":\", value)\n```\n\n```text\n>> The Legend of Zelda: Breath of the Wild\n>> HACPAAAAA AAAA\n>> 2017-03-03 00:00:00\n>> 1\n>> PEGI 12\n>> https://www.nintendo.co.uk/Games/Nintendo-Switch/The-Legend-of-Zelda-Breath-of-the-Wild-1173609.html\n>>  * Amiibo Supported : True\n>>  * Demo Available : False\n>>  * DLC Available : False\n>>  * Nintendo Switch Online Required : False\n>>  * Save Data Cloud Supported : True\n>>  * Voice Chat Supported : False\n```\n\n```python\nfrom nintendeals import noj\n\ngame = noj.game_info(\"70010000000026\")\nprint(game.title)\nprint(game.product_code, game.unique_id)\nprint(game.release_date)\nprint(game.players)\nprint(str(game.rating[0]), game.rating[1])\nprint(game.eshop.jp_jp)\n\nfor feature, value in game.features.items():\n    print(\" *\", str(feature), \":\", value)\n```\n\n```text\n>> \u30bc\u30eb\u30c0\u306e\u4f1d\u8aac\u3000\u30d6\u30ec\u30b9 \u30aa\u30d6 \u30b6 \u30ef\u30a4\u30eb\u30c9\n>> HACAAAAA AAAA\n>> 2017-03-03 00:00:00\n>> 1\n>> CERO B\n>> https://store-jp.nintendo.com/list/software/70010000000026.html\n>>  * Amiibo Supported : True\n>>  * DLC Available : True\n>>  * Nintendo Switch Online Required : False\n```\n\n\n### Pricing\n\nGiven a country code (using the alpha-2 iso standard) and a game or list of games this service will fetch the current \npricing of that/those games for that country. Since this service uses nsuids to fetch the price, make sure that the\ngames that you provide have the regional nsuid that matches the country that you want. For example, only the nsuid for\nthe American region will be able to fetch you the prices of Canada, Mexico and United Stated but not for Japan or Spain.\n\n```python\nfrom nintendeals import noe\nfrom nintendeals.api import prices\n\ngame = noe.game_info(\"70010000007705\")\nprint(game.title)\nprint()\n\nprice = prices.get_price(game, country=\"CZ\")  # Czech Republic\nprint(price.currency)\nprint(price.value)\nprint(price.sale_discount, \"%\")\nprint(price.sale_value)\nprint(price.sale_start)\nprint(price.sale_end)\n\n# Alternatively you can do this for the same effect:\nprice = game.price(country=\"CZ\") \n``` \n\n```text\nDead Cells\n\nCZK\n625.0\n80 %\n500.0\n2020-04-19 22:00:00\n2020-05-03 21:59:59\n```\n\nTo reduce the amount of call to the prices api, you can also use the `get_prices` service that works in a similar way\nbut it expects a list of games instead of only one:\n\n```python\nfrom nintendeals import noa\nfrom nintendeals.api import prices\n\nbotw = noa.game_info(\"70010000000025\")\nprint(botw.title)\nceleste = noa.game_info(\"70010000006442\")\nprint(celeste.title)\n\nprint()\n\nprices = prices.get_prices([botw, celeste], country=\"US\")\nfor nsuid, price in prices:\n    print(nsuid)\n    print(price.value)\n    print(price.sale_value)\n    print()\n```\n\n```text\nThe Legend of Zelda\u2122: Breath of the Wild\nCeleste\n\n70010000000025\n59.99\nNone\n\n70010000006442\n19.99\n4.99\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Scraping tools for Nintendo Switch games and prices on NA, EU and JP.",
    "version": "3.1.3",
    "project_urls": {
        "Documentation": "https://github.com/fedecalendino/nintendeals/blob/main/README.md",
        "Homepage": "https://github.com/fedecalendino/nintendeals"
    },
    "split_keywords": [
        "nintendo",
        " deals"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd0dd1fbbd94fb55d4c95cc3e1656d8d63add1fdddcb1ab32ba89767b76c2d2f",
                "md5": "f7ec2d2ed123f13dfa27c890931e6733",
                "sha256": "3f397d8a7e08089f8d5e42931127f4f3ca6feca2891543d662622781c5c85df8"
            },
            "downloads": -1,
            "filename": "nintendeals-3.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7ec2d2ed123f13dfa27c890931e6733",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 22442,
            "upload_time": "2024-09-28T12:14:07",
            "upload_time_iso_8601": "2024-09-28T12:14:07.821982Z",
            "url": "https://files.pythonhosted.org/packages/bd/0d/d1fbbd94fb55d4c95cc3e1656d8d63add1fdddcb1ab32ba89767b76c2d2f/nintendeals-3.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2870634b517a8856f0153146b9013b3297a4afc336d018b4c1d73beaa5c70e70",
                "md5": "f388499d77b7cbdeb8516466ba14b93a",
                "sha256": "1329ca59d5229a6ae6da9ee94a319f7de7fc9ab3f0d2fd16581b6421e50f5bb8"
            },
            "downloads": -1,
            "filename": "nintendeals-3.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f388499d77b7cbdeb8516466ba14b93a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 16069,
            "upload_time": "2024-09-28T12:14:09",
            "upload_time_iso_8601": "2024-09-28T12:14:09.174497Z",
            "url": "https://files.pythonhosted.org/packages/28/70/634b517a8856f0153146b9013b3297a4afc336d018b4c1d73beaa5c70e70/nintendeals-3.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-28 12:14:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fedecalendino",
    "github_project": "nintendeals",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nintendeals"
}
        
Elapsed time: 0.63250s