gromp


Namegromp JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/wilhelmagren/gromp
SummaryHolistic Python implementation of the public Riot Games Developer API.
upload_time2023-11-05 15:33:32
maintainer
docs_urlNone
authorWilhelm Ågren
requires_python>=3.8,<3.13
licenseMIT
keywords python api league-of-legends discord-bot api-wrapper riot-games riot riot-games-api teamfight-tactics legends-of-runeterra valorant
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<br/>
<div align="left">
<br/>
<p align="center">
<a href="https://github.com/wilhelmagren/gromp">
<img align="center" width=75% src="./docs/images/gromp-banner.png"></img>
</a>
</p>
</div>

[![PyPI - Version](https://img.shields.io/pypi/v/gromp)](https://pypi.org/project/gromp/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/wilhelmagren/gromp/branch/main/graph/badge.svg?token=52WSCE8Q09)](https://codecov.io/gh/willeagren/gromp)
[![CI](https://github.com/wilhelmagren/gromp/actions/workflows/ci.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/ci.yml)
[![CD](https://github.com/wilhelmagren/gromp/actions/workflows/cd.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/cd.yml)
[![Tests](https://github.com/wilhelmagren/gromp/actions/workflows/tests.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/tests.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Lint style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)

</div>

## 🔎 Overview
*gromp* is a holistic wrapper of the public [Riot Games developer API](https://developer.riotgames.com/apis), 
written in Python. All public methods are, as of 2023-02-27, implemented.

The core principle of the wrapper is to offer a complete, yet simple, interface which implements some of the core functionality that a developer might want to communicate with the Riot Games developer API.

For a full list of all available requests, see each respective endpoint documentation.

## 🔑 Requirements

- To perform requests you need an API key from Riot Games, get yours [here](https://developer.riotgames.com/).

## 📦 Installation
Either clone this repository and perform a local install with [poetry](https://github.com/python-poetry/poetry/tree/master) accordingly
```
git clone https://github.com/wilhelmagren/gromp.git
cd gromp
poetry install
```
or install the most recent release from the Python Package Index (PyPI).
```
pip install gromp
```


## 🚀 Example usage
Any HTTP errors that are returned by the requested API are propagated and, as of writing this, not handled.
```python
import gromp
from gromp import (
    LeaguePlatforms,
    LeagueRegions,
)

platform = LeaguePlatforms.euw1
region = LeagueRegions.EUROPE
token = '<api-key>'

# Here we setup a hook for League of Legends. We specify platform and region
# to perform all REST requests to, the length of the RSA keys used to encrypt
# our token, and the number of seconds to wait before a timeout.
hook = gromp.hook.League(
    token,
    platform=platform,
    region=region,
    keylen=1024,
    timeout=10,
)

# One of the default handlers parses the HTTP response as a JSON
# dictionary, see all available attributes for the object at the
# Riot Games API documentation https://developer.riotgames.com/apis
summoner = hook.summoner.by_name('1 900 976 JUICE')

# We can also get the summoner if we know the encrypted
# puuid, lets try and see if they are actually the same...
summoner_from_puuid = hook.summoner.by_puuid(summoner['puuid'])

assert summoner == summoner_from_puuid

# Great, we get the same summoner, me. Let's try and get
# some of my played games from the match API endpoint.
matches = hook.match.matchlist_by_puuid(
    summoner['puuid'],
    start=10,
    count=5,
)

assert len(matches) == 5

# Now we can request the match data for all the match id's which we
# got from the previous request. This is unfortunately the only 
# process of getting specific match data... it is rather tedious.
for match_id in matches:
    m = hook.match.by_id(match_id)
    for participant in m['info']['participants']:
        if participant['puuid'] == summoner['puuid']:
            print(participant['win'])

```

## 💡 Gromp facts
His real name is Lord Grompulus Kevin Ribbiton of Croaksworth, and he likes to eat small insects, mushrooms, and people ([source](https://leagueoflegends.fandom.com/wiki/Gromp)). 

## 📋 License
All code is to be held under a general MIT license, please see [LICENSE](https://github.com/willeagren/gromp/blob/main/LICENSE) for specific information.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wilhelmagren/gromp",
    "name": "gromp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.13",
    "maintainer_email": "",
    "keywords": "python,api,league-of-legends,discord-bot,api-wrapper,riot-games,riot,riot-games-api,teamfight-tactics,legends-of-runeterra,valorant",
    "author": "Wilhelm \u00c5gren",
    "author_email": "wilhelmagren98@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/68/28/bf375d67ed5b9e426d2b13f19eca46fa1c56d3784353551181321e15b4ff/gromp-1.0.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n<br/>\n<div align=\"left\">\n<br/>\n<p align=\"center\">\n<a href=\"https://github.com/wilhelmagren/gromp\">\n<img align=\"center\" width=75% src=\"./docs/images/gromp-banner.png\"></img>\n</a>\n</p>\n</div>\n\n[![PyPI - Version](https://img.shields.io/pypi/v/gromp)](https://pypi.org/project/gromp/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/wilhelmagren/gromp/branch/main/graph/badge.svg?token=52WSCE8Q09)](https://codecov.io/gh/willeagren/gromp)\n[![CI](https://github.com/wilhelmagren/gromp/actions/workflows/ci.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/ci.yml)\n[![CD](https://github.com/wilhelmagren/gromp/actions/workflows/cd.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/cd.yml)\n[![Tests](https://github.com/wilhelmagren/gromp/actions/workflows/tests.yml/badge.svg)](https://github.com/wilhelmagren/gromp/actions/workflows/tests.yml)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Lint style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n\n</div>\n\n## \ud83d\udd0e Overview\n*gromp* is a holistic wrapper of the public [Riot Games developer API](https://developer.riotgames.com/apis), \nwritten in Python. All public methods are, as of 2023-02-27, implemented.\n\nThe core principle of the wrapper is to offer a complete, yet simple, interface which implements some of the core functionality that a developer might want to communicate with the Riot Games developer API.\n\nFor a full list of all available requests, see each respective endpoint documentation.\n\n## \ud83d\udd11 Requirements\n\n- To perform requests you need an API key from Riot Games, get yours [here](https://developer.riotgames.com/).\n\n## \ud83d\udce6 Installation\nEither clone this repository and perform a local install with [poetry](https://github.com/python-poetry/poetry/tree/master) accordingly\n```\ngit clone https://github.com/wilhelmagren/gromp.git\ncd gromp\npoetry install\n```\nor install the most recent release from the Python Package Index (PyPI).\n```\npip install gromp\n```\n\n\n## \ud83d\ude80 Example usage\nAny HTTP errors that are returned by the requested API are propagated and, as of writing this, not handled.\n```python\nimport gromp\nfrom gromp import (\n    LeaguePlatforms,\n    LeagueRegions,\n)\n\nplatform = LeaguePlatforms.euw1\nregion = LeagueRegions.EUROPE\ntoken = '<api-key>'\n\n# Here we setup a hook for League of Legends. We specify platform and region\n# to perform all REST requests to, the length of the RSA keys used to encrypt\n# our token, and the number of seconds to wait before a timeout.\nhook = gromp.hook.League(\n    token,\n    platform=platform,\n    region=region,\n    keylen=1024,\n    timeout=10,\n)\n\n# One of the default handlers parses the HTTP response as a JSON\n# dictionary, see all available attributes for the object at the\n# Riot Games API documentation https://developer.riotgames.com/apis\nsummoner = hook.summoner.by_name('1 900 976 JUICE')\n\n# We can also get the summoner if we know the encrypted\n# puuid, lets try and see if they are actually the same...\nsummoner_from_puuid = hook.summoner.by_puuid(summoner['puuid'])\n\nassert summoner == summoner_from_puuid\n\n# Great, we get the same summoner, me. Let's try and get\n# some of my played games from the match API endpoint.\nmatches = hook.match.matchlist_by_puuid(\n    summoner['puuid'],\n    start=10,\n    count=5,\n)\n\nassert len(matches) == 5\n\n# Now we can request the match data for all the match id's which we\n# got from the previous request. This is unfortunately the only \n# process of getting specific match data... it is rather tedious.\nfor match_id in matches:\n    m = hook.match.by_id(match_id)\n    for participant in m['info']['participants']:\n        if participant['puuid'] == summoner['puuid']:\n            print(participant['win'])\n\n```\n\n## \ud83d\udca1 Gromp facts\nHis real name is Lord Grompulus Kevin Ribbiton of Croaksworth, and he likes to eat small insects, mushrooms, and people ([source](https://leagueoflegends.fandom.com/wiki/Gromp)). \n\n## \ud83d\udccb License\nAll code is to be held under a general MIT license, please see [LICENSE](https://github.com/willeagren/gromp/blob/main/LICENSE) for specific information.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Holistic Python implementation of the public Riot Games Developer API.",
    "version": "1.0.0",
    "project_urls": {
        "Bug tracker": "https://github.com/wilhelmagren/gromp/issues",
        "Homepage": "https://github.com/wilhelmagren/gromp",
        "Repository": "https://github.com/wilhelmagren/gromp"
    },
    "split_keywords": [
        "python",
        "api",
        "league-of-legends",
        "discord-bot",
        "api-wrapper",
        "riot-games",
        "riot",
        "riot-games-api",
        "teamfight-tactics",
        "legends-of-runeterra",
        "valorant"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "526bae91bbe6af7c004d8cf787ca1050c3d4a351184f32ab06559447cb56d054",
                "md5": "fbc3ae456e810b74cb2bd6a4196364a3",
                "sha256": "e2318edfff0f4df649f2f59500d4e9986348df413a12652f43c8f683f86d6f59"
            },
            "downloads": -1,
            "filename": "gromp-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fbc3ae456e810b74cb2bd6a4196364a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.13",
            "size": 92914,
            "upload_time": "2023-11-05T15:33:30",
            "upload_time_iso_8601": "2023-11-05T15:33:30.550603Z",
            "url": "https://files.pythonhosted.org/packages/52/6b/ae91bbe6af7c004d8cf787ca1050c3d4a351184f32ab06559447cb56d054/gromp-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6828bf375d67ed5b9e426d2b13f19eca46fa1c56d3784353551181321e15b4ff",
                "md5": "6cdd602bf5b416585e1eb97c8e3e5a73",
                "sha256": "47b3612ebe57126dd3cb5f254cad597108b93599708eb0bd732d4f3e7a062c43"
            },
            "downloads": -1,
            "filename": "gromp-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6cdd602bf5b416585e1eb97c8e3e5a73",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.13",
            "size": 18651,
            "upload_time": "2023-11-05T15:33:32",
            "upload_time_iso_8601": "2023-11-05T15:33:32.556048Z",
            "url": "https://files.pythonhosted.org/packages/68/28/bf375d67ed5b9e426d2b13f19eca46fa1c56d3784353551181321e15b4ff/gromp-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-05 15:33:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wilhelmagren",
    "github_project": "gromp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gromp"
}
        
Elapsed time: 0.17143s