# Gameprices
[![Build](https://github.com/snipem/psnprices/actions/workflows/build.yaml/badge.svg)](https://github.com/snipem/psnprices/actions/workflows/build.yaml)
Command line tool for alerting price drops in the Sony PlayStation Network (PSN) and the Nintendo Eshop.
## Description
**Since the PSN upgrade that came with the release of PlayStation 5, some functionality of the PSN interface is broken. Currently only searching by a name query is working**
The Sony Entertainment Network (SEN) uses CIDs to identify items in its catalogue. In order to alert you on the desired price of an SEN you need the CID. Use your Browser (cid GET parameter in URL) or this script (`--query`) to retrieve the CID.
In order to check the price of an item. You need a store identifier. These store identifiers are known to work:
* DE/de (Germany)
* GB/en (Great Britain)
* US/en (United States)
* SE/en (Sweden)
* JP/jp (Japan)
Prices are always in the local currency. Therefore, it is € for DE/de and £ for GB/en. Additionally, prices are those for PlayStation Plus users.
The Eshop implementation lacks unique identifiers, because the Eshop does not support searching for unique identifiers. Therefore, an identifier is constructed containing the game name.
## Installation
Use PyPI to install `gameprices`
```bash
pip install gameprices
```
This will install the Python modules and also the following command line tools
```
psncli
eshopcli
psnmailalert
dealsmailalert
```
### Install development build
```bash
pip install .
```
## Usage
### Mail alerting for single alerts you define yourself
Just run `psnmailalert` for mail alerting. See example below. Alerts are set in the `alerts.csv` file. If no store is set. The German / European store is used as a default.
### Command line interface
```bash
usage: psncli [-h] [--id ID] [--store STORE] [--price PRICE] [--query QUERY] [--json] [--log]
optional arguments:
-h, --help show this help message and exit
--id ID, -i ID CID of game to check
--store STORE, -s STORE Regional PSN store to check. Default: 'DE/de'
--price PRICE, -p PRICE Desired price of game
--query QUERY, -q QUERY Name of item to search for
--json, -j Print JSON
--log, -l Write to log file
```
#### Retrieving UTF-8 encoded output on terminals
You may have to tell Python that your terminal is capable of dealing with UTF-8 outputs. Some PSN items are annotated with trademark, copyright or foreign language specific symbols. To do so set `export PYTHONIOENCODING=utf-8` in your terminal window.
## Example
You may run this script with the following command line variants:
### Mail alerting - Get a mail when alerts have been met
With `psnmailalert` you may set alerts for price drops in the `alerts.csv` file. The first value is the CID for the item, the second is the price to be matched in order to alert you by mail, and the second value is the store to search in. You may mix stores in the `alerts.csv`. After a price has been matched, the alert is removed from `alerts.csv`. You will not get any further alerts for that item.
```csv
P0001-NPEJ00305_00-B000000000001030,19.00,DE/de
P0001-NPEJ00305_00-B000000000001030,19.00,DE/de
EP0102-CUSA02521_00-MEGAMANLEGACY000,7.00
UP0102-CUSA02516_00-MEGAMANLEGACY000,7.00,US/en
P0101-ULES01372_00-GPCMETALGE000001,10.00,DE/de
```
If the store value is left blank, the script tries to extract the store from the beginning character of the CID.
In order to receive mails you have to set your account settings in the file `mailconfig.json`. See `mailconfig.json_example` for an example config.
To run `psnmailalert`, just type:
psnmailalert
#### Example mail
![Mail with alerts](https://raw.githubusercontent.com/snipem/psnprices/master/res/mail.png "Mail with alerts")
### Searching for the CID of an item
Define the name of a game and the store.
psncli --query "metal gear solid peace walker" --store DE/de
You will get a result containing one to many search results with the CID. The first output of each search line is the CID, the second the name, the third the supported systems and the last is a description of the item type in the local store language. It is "Vollversion" here which means "full version" in German.
EP0101-ULES01372_00-GPCMETALGE000001 Metal Gear Solid: Peace Walker PS Vita,PSP® 9.99 GAME
Use the `--json` flag to get the same output as JSON.
```bash
eshopcli --json -q "Dynasty Warriors 8 Xtreme Legends"
[
{
"id": "1490013",
"name": "DYNASTY WARRIORS 8: Xtreme Legends Definitive Edition",
"type": "GAME",
"prices": [
{
"price": 39.99,
"currency": "",
"type": "OFFER"
}
],
"platforms": [
"Nintendo Switch"
]
},
...
```
### Check if desired price has been met
The price is in local currency. As exit statuses render the outcome of the alert, you may send mails or desktop notifications with `&&` or `||`. In this example, there is a string printed to the console.
```bash
psncli --id EP0101-ULES01372_00-GPCMETALGE000001 --store DE/de --price 15.00 &&
echo "Price matched, let's buy Metal Gear Solid PW"
```
## Disclaimer
This script is not associated with Sony, Sony PlayStation, the PlayStation Network in any kind. It consumes a public interface that is publicly advertised to the browser to list store contents.
This script is not associated with Nintendo, Nintendo Switch, or the Nintendo Eshop in any kind. It consumes a public interface that is publicly advertised to the browser to list store contents.
Raw data
{
"_id": null,
"home_page": "https://github.com/snipem/psnprices",
"name": "gameprices",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "playstation,eshop,store,prices",
"author": "Matthias Kuech",
"author_email": "post@matthias-kuech.de",
"download_url": "https://files.pythonhosted.org/packages/7c/13/0e57c9179d488802cb8cf98a4d23617e6444602c87db55ff5fc2f0826df0/gameprices-1.4.0.tar.gz",
"platform": null,
"description": "# Gameprices\n\n[![Build](https://github.com/snipem/psnprices/actions/workflows/build.yaml/badge.svg)](https://github.com/snipem/psnprices/actions/workflows/build.yaml)\n\nCommand line tool for alerting price drops in the Sony PlayStation Network (PSN) and the Nintendo Eshop.\n\n## Description\n\n**Since the PSN upgrade that came with the release of PlayStation 5, some functionality of the PSN interface is broken. Currently only searching by a name query is working**\n\nThe Sony Entertainment Network (SEN) uses CIDs to identify items in its catalogue. In order to alert you on the desired price of an SEN you need the CID. Use your Browser (cid GET parameter in URL) or this script (`--query`) to retrieve the CID.\n\nIn order to check the price of an item. You need a store identifier. These store identifiers are known to work:\n\n* DE/de (Germany)\n* GB/en (Great Britain)\n* US/en (United States)\n* SE/en (Sweden)\n* JP/jp (Japan)\n\nPrices are always in the local currency. Therefore, it is \u20ac for DE/de and \u00a3 for GB/en. Additionally, prices are those for PlayStation Plus users.\n\nThe Eshop implementation lacks unique identifiers, because the Eshop does not support searching for unique identifiers. Therefore, an identifier is constructed containing the game name.\n\n## Installation\n\nUse PyPI to install `gameprices`\n\n```bash\npip install gameprices\n```\n\nThis will install the Python modules and also the following command line tools\n\n```\npsncli\neshopcli\npsnmailalert\ndealsmailalert\n```\n\n### Install development build\n\n```bash\npip install .\n```\n\n## Usage\n\n### Mail alerting for single alerts you define yourself\n\nJust run `psnmailalert` for mail alerting. See example below. Alerts are set in the `alerts.csv` file. If no store is set. The German / European store is used as a default.\n\n### Command line interface\n\n```bash\nusage: psncli [-h] [--id ID] [--store STORE] [--price PRICE] [--query QUERY] [--json] [--log]\n\noptional arguments:\n-h, --help show this help message and exit\n--id ID, -i ID CID of game to check\n--store STORE, -s STORE Regional PSN store to check. Default: 'DE/de'\n--price PRICE, -p PRICE Desired price of game\n--query QUERY, -q QUERY Name of item to search for\n--json, -j Print JSON\n--log, -l Write to log file\n```\n\n#### Retrieving UTF-8 encoded output on terminals\n\nYou may have to tell Python that your terminal is capable of dealing with UTF-8 outputs. Some PSN items are annotated with trademark, copyright or foreign language specific symbols. To do so set `export PYTHONIOENCODING=utf-8` in your terminal window.\n\n## Example\n\nYou may run this script with the following command line variants:\n\n### Mail alerting - Get a mail when alerts have been met\n\nWith `psnmailalert` you may set alerts for price drops in the `alerts.csv` file. The first value is the CID for the item, the second is the price to be matched in order to alert you by mail, and the second value is the store to search in. You may mix stores in the `alerts.csv`. After a price has been matched, the alert is removed from `alerts.csv`. You will not get any further alerts for that item.\n\n```csv\nP0001-NPEJ00305_00-B000000000001030,19.00,DE/de\nP0001-NPEJ00305_00-B000000000001030,19.00,DE/de\nEP0102-CUSA02521_00-MEGAMANLEGACY000,7.00\nUP0102-CUSA02516_00-MEGAMANLEGACY000,7.00,US/en\nP0101-ULES01372_00-GPCMETALGE000001,10.00,DE/de\n```\n\nIf the store value is left blank, the script tries to extract the store from the beginning character of the CID.\n\n In order to receive mails you have to set your account settings in the file `mailconfig.json`. See `mailconfig.json_example` for an example config.\n\n To run `psnmailalert`, just type:\n\n psnmailalert\n\n#### Example mail\n\n![Mail with alerts](https://raw.githubusercontent.com/snipem/psnprices/master/res/mail.png \"Mail with alerts\")\n\n### Searching for the CID of an item\n\nDefine the name of a game and the store.\n\n psncli --query \"metal gear solid peace walker\" --store DE/de\n\nYou will get a result containing one to many search results with the CID. The first output of each search line is the CID, the second the name, the third the supported systems and the last is a description of the item type in the local store language. It is \"Vollversion\" here which means \"full version\" in German.\n\n EP0101-ULES01372_00-GPCMETALGE000001 Metal Gear Solid: Peace Walker PS Vita,PSP\u00ae 9.99 GAME\n\nUse the `--json` flag to get the same output as JSON.\n\n```bash\neshopcli --json -q \"Dynasty Warriors 8 Xtreme Legends\"\n[\n {\n \"id\": \"1490013\",\n \"name\": \"DYNASTY WARRIORS 8: Xtreme Legends Definitive Edition\",\n \"type\": \"GAME\",\n \"prices\": [\n {\n \"price\": 39.99,\n \"currency\": \"\",\n \"type\": \"OFFER\"\n }\n ],\n \"platforms\": [\n \"Nintendo Switch\"\n ]\n },\n...\n```\n\n### Check if desired price has been met\n\nThe price is in local currency. As exit statuses render the outcome of the alert, you may send mails or desktop notifications with `&&` or `||`. In this example, there is a string printed to the console.\n\n```bash\npsncli --id EP0101-ULES01372_00-GPCMETALGE000001 --store DE/de --price 15.00 &&\necho \"Price matched, let's buy Metal Gear Solid PW\"\n```\n\n## Disclaimer\n\nThis script is not associated with Sony, Sony PlayStation, the PlayStation Network in any kind. It consumes a public interface that is publicly advertised to the browser to list store contents.\n\nThis script is not associated with Nintendo, Nintendo Switch, or the Nintendo Eshop in any kind. It consumes a public interface that is publicly advertised to the browser to list store contents.\n",
"bugtrack_url": null,
"license": "GPL2",
"summary": "An interface for the undocumented Sony PlayStation Store PSN and Nintendo Eshop Apis",
"version": "1.4.0",
"split_keywords": [
"playstation",
"eshop",
"store",
"prices"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7c130e57c9179d488802cb8cf98a4d23617e6444602c87db55ff5fc2f0826df0",
"md5": "1ed4422e0122cd5bdf397752e6e4c0b2",
"sha256": "10ff2467c3963f04c8e7c0f77dad37be1cfe107d237e923862b5db2a17bec31e"
},
"downloads": -1,
"filename": "gameprices-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "1ed4422e0122cd5bdf397752e6e4c0b2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 23924,
"upload_time": "2023-03-22T21:03:42",
"upload_time_iso_8601": "2023-03-22T21:03:42.160140Z",
"url": "https://files.pythonhosted.org/packages/7c/13/0e57c9179d488802cb8cf98a4d23617e6444602c87db55ff5fc2f0826df0/gameprices-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-22 21:03:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "snipem",
"github_project": "psnprices",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "gameprices"
}