gog-price-checker


Namegog-price-checker JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/iampopovich/gog_price_checker
SummaryA tool to check game prices from GOG API
upload_time2023-08-03 16:27:21
maintainer
docs_urlNone
authorAlex
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Game Price Checker 💵
[![PyPI](https://img.shields.io/pypi/v/gog-price-checker)](https://pypi.org/project/gog-price-checker/)
![Latest build status](https://github.com/iampopovich/gog_price_checker/workflows/upload-python-package/badge.svg)

The **Game Price Checker** is a Python script that allows you to extract a URL from the clipboard, download the web page content, and retrieve the price of a game from the GOG API. The script is designed to work on macOS systems.

## Requirements

- Python 3.x
- Requests library (for making HTTP requests)
- Regular expressions (re) module
- Threading module (for concurrent requests)
- Logging module (for logging)

## Installation
```
pip install gog-price-checker
```

## How to Use

1. Copy a URL containing a game page (e.g., `https://www.gog.com/game/diablo`) to the clipboard.

2. Run the Python script with the following arguments:

    - `-u`, `--url`: The URL of the game page to scrape (required).
    - `-n`, `--normalize`: (Optional) Normalize currencies to USD.
    - `-c`, `--count` : (Optional) default = 10, number of countries to show in sorted prices result
    - `-p`, `--pretty` : (Optional) shows result as pretty table

Example:
```
gog-price-checker -u https://www.gog.com/game/diablo -n -p
```
Output:
```
Country                   Price      Currency
---------------------------------------------
Ukraine                   5.51       USD
Moldova                   5.51       USD
Kazakhstan                5.51       USD
Armenia                   5.51       USD
China                     5.57       USD
Poland                    8.34       USD
Australia                 9.24       USD
New Zealand               9.24       USD
Andorra                   9.99       USD
Spain                     9.99       USD
Sweden                    9.99       USD
...
```

3. The script will download the web page, extract the product ID, and fetch the price from the GOG API for multiple countries concurrently using threads.

4. The prices for different countries will be displayed in descending order of value. If the `-n` flag is provided, the prices will be normalized to USD.

## Limitations

- The script uses regular expressions to extract the product ID and prices, which might not handle all possible web page structures or API responses. Some pages may require additional parsing logic.
- The API endpoint used to fetch prices is specific to GOG, and it may change over time. Ensure the API remains accessible and the script is updated accordingly.

## Important Note

- The script is provided as-is, and it is advisable to use it responsibly and in accordance with the website's terms of use. Automated scraping of websites can put a strain on their servers, so use the script with caution and avoid making excessive requests.

## Credits

- This script is provided as an educational example and is not intended for commercial purposes. It was created as part of a task and is not an official GOG product.

## License

- The **Game Price Checker** Python script is released under the [MIT License](LICENSE). Feel free to modify and distribute the script according to the terms of the license.

## Disclaimer

- The author of this script is not responsible for any misuse or consequences of using the script on unauthorized websites. Always make sure you have the right to access and use the data from the websites you interact with.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/iampopovich/gog_price_checker",
    "name": "gog-price-checker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alex",
    "author_email": "iampopovich@example.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/6e/734effb6466c98ee832ec8ba8f6fcb8711d596d39f9bd372198561f5fb7b/gog-price-checker-1.0.0.tar.gz",
    "platform": null,
    "description": "# Game Price Checker \ud83d\udcb5\n[![PyPI](https://img.shields.io/pypi/v/gog-price-checker)](https://pypi.org/project/gog-price-checker/)\n![Latest build status](https://github.com/iampopovich/gog_price_checker/workflows/upload-python-package/badge.svg)\n\nThe **Game Price Checker** is a Python script that allows you to extract a URL from the clipboard, download the web page content, and retrieve the price of a game from the GOG API. The script is designed to work on macOS systems.\n\n## Requirements\n\n- Python 3.x\n- Requests library (for making HTTP requests)\n- Regular expressions (re) module\n- Threading module (for concurrent requests)\n- Logging module (for logging)\n\n## Installation\n```\npip install gog-price-checker\n```\n\n## How to Use\n\n1. Copy a URL containing a game page (e.g., `https://www.gog.com/game/diablo`) to the clipboard.\n\n2. Run the Python script with the following arguments:\n\n    - `-u`, `--url`: The URL of the game page to scrape (required).\n    - `-n`, `--normalize`: (Optional) Normalize currencies to USD.\n    - `-c`, `--count` : (Optional) default = 10, number of countries to show in sorted prices result\n    - `-p`, `--pretty` : (Optional) shows result as pretty table\n\nExample:\n```\ngog-price-checker -u https://www.gog.com/game/diablo -n -p\n```\nOutput:\n```\nCountry                   Price      Currency\n---------------------------------------------\nUkraine                   5.51       USD\nMoldova                   5.51       USD\nKazakhstan                5.51       USD\nArmenia                   5.51       USD\nChina                     5.57       USD\nPoland                    8.34       USD\nAustralia                 9.24       USD\nNew Zealand               9.24       USD\nAndorra                   9.99       USD\nSpain                     9.99       USD\nSweden                    9.99       USD\n...\n```\n\n3. The script will download the web page, extract the product ID, and fetch the price from the GOG API for multiple countries concurrently using threads.\n\n4. The prices for different countries will be displayed in descending order of value. If the `-n` flag is provided, the prices will be normalized to USD.\n\n## Limitations\n\n- The script uses regular expressions to extract the product ID and prices, which might not handle all possible web page structures or API responses. Some pages may require additional parsing logic.\n- The API endpoint used to fetch prices is specific to GOG, and it may change over time. Ensure the API remains accessible and the script is updated accordingly.\n\n## Important Note\n\n- The script is provided as-is, and it is advisable to use it responsibly and in accordance with the website's terms of use. Automated scraping of websites can put a strain on their servers, so use the script with caution and avoid making excessive requests.\n\n## Credits\n\n- This script is provided as an educational example and is not intended for commercial purposes. It was created as part of a task and is not an official GOG product.\n\n## License\n\n- The **Game Price Checker** Python script is released under the [MIT License](LICENSE). Feel free to modify and distribute the script according to the terms of the license.\n\n## Disclaimer\n\n- The author of this script is not responsible for any misuse or consequences of using the script on unauthorized websites. Always make sure you have the right to access and use the data from the websites you interact with.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A tool to check game prices from GOG API",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/iampopovich/gog_price_checker"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "167114a3635e06f00a60bf1811c513a3372a010bc4da87afa819f419194a7e43",
                "md5": "f5e4d8401d1a115876ff8c1d7efc5092",
                "sha256": "f470d2c478a04cc6a526a6d0b930df6b4f671d466f8e601007f5b0fa81a6d888"
            },
            "downloads": -1,
            "filename": "gog_price_checker-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5e4d8401d1a115876ff8c1d7efc5092",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5387,
            "upload_time": "2023-08-03T16:27:20",
            "upload_time_iso_8601": "2023-08-03T16:27:20.595915Z",
            "url": "https://files.pythonhosted.org/packages/16/71/14a3635e06f00a60bf1811c513a3372a010bc4da87afa819f419194a7e43/gog_price_checker-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c96e734effb6466c98ee832ec8ba8f6fcb8711d596d39f9bd372198561f5fb7b",
                "md5": "33b8752d8053711507539eaae797559d",
                "sha256": "88a9fde3d44225bdfee8e88530a376d9949718aea6abd2728755d7d97b3d6dc3"
            },
            "downloads": -1,
            "filename": "gog-price-checker-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "33b8752d8053711507539eaae797559d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4847,
            "upload_time": "2023-08-03T16:27:21",
            "upload_time_iso_8601": "2023-08-03T16:27:21.508325Z",
            "url": "https://files.pythonhosted.org/packages/c9/6e/734effb6466c98ee832ec8ba8f6fcb8711d596d39f9bd372198561f5fb7b/gog-price-checker-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-03 16:27:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "iampopovich",
    "github_project": "gog_price_checker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gog-price-checker"
}
        
Elapsed time: 0.10342s