opgg.py


Nameopgg.py JSON
Version 1.3.0 PyPI version JSON
download
home_pagehttps://github.com/ShoobyDoo/OPGG.py
SummaryAn unofficial Python library for scraping/accessing data from OP.GG
upload_time2024-04-29 06:37:36
maintainerNone
docs_urlNone
authorShoobyDoo
requires_python<4,>=3.11
licenseNone
keywords opgg league-of-legends web-scraping summoner data riot-api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FShoobyDoo%2FOPGG.py&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23DDDDDD&title=visits&edge_flat=false)](https://hits.seeyoufarm.com)

# OPGG.py
An unofficial Python library for accessing OPGG data.
#### You can view the current active developments on the [OPGG.py Project](https://github.com/users/ShoobyDoo/projects/2) page

## Prerequisites

* [Python 3.11](https://www.python.org/downloads/) 
    
    *Note: Will likely work on versions slightly older or newer*

## Installation

### Automatic

This library is available as a [pip package](https://pypi.org/project/opgg.py/) and can be installed via the following command:
```
py -m pip install opgg.py
```

### Manual

#### Dependencies
* [requests](https://pypi.org/project/requests/)
* [beautifulsoup4](https://pypi.org/project/beautifulsoup4/)

Alternatively, you can use the provided requirements.txt to install the required libraries by running the following command: <br>
```
py -m pip install -r requirements.txt
```

## Usage / Basic Example

### Importing the library
```python
from opgg.opgg import OPGG
from opgg.summoner import Summoner


def main():    
    opgg = OPGG()
    
    summoner: Summoner
    for summoner in opgg.search(["ColbyFaulkn1"]):
        print(summoner)
        
    
if __name__ == "__main__":
    main()
```

### Output
**Important Note:** The information returned below is a summary view with the most important parts of each object shown "at a glance". 
Many of the objects have several additional properties that can be accessed by referencing the object in code.
```
[Summoner: ColbyFaulkn1]
--------------------------------------------------------------------------------
Id                          (int) | 113462497
Summoner Id                 (str) | h7UNeo4aQz9Rnc0FKlKvgrEgEFEoJxHMLN7oMAGvrsFI2l9Mk0-eWe1yKg
Account Id                  (str) | Qw7zgbaE-iIsC_n4VhtWXY83u0f21TQL2e6xi2Z-bYAm8KiQIFafhPfb
Puuid                       (str) | k-CwhMDDAwLZYjLMcehGbvFoNsPm4HyvWqWHmkyrgX91vZtUbUDvTPaCkiPoVpPx_SjRVW8RU8Hx0g
Name                        (str) | ColbyFaulkn1
Internal Name               (str) | colbyfaulkn1
Profile Image Url           (str) | https://opgg-static.akamaized.net/meta/images/profile_icons/profileIcon907.jpg
Level                       (int) | 45
Updated At             (datetime) | 2023-08-20T07:26:15+09:00
Renewable At           (datetime) | 2023-08-20T07:28:15+09:00
Previous Seasons     (SeasonInfo) | [List (1)]
                                  | Season(season=SeasonInfo(display_value=2023, is_preseason=False), tier_info=Tier(tier=SILVER, division=1, lp=1))
League Stats        (LeagueStats) | [List (3)]
                                  | LeagueStats(queue_info=QueueInfo(game_type=SOLORANKED), tier_info=Tier(tier=SILVER, division=2, lp=64), win=3, lose=3)
                                  | LeagueStats(queue_info=QueueInfo(game_type=FLEXRANKED), tier_info=Tier(tier=None, division=None, lp=None), win=1, lose=1)
                                  | LeagueStats(queue_info=QueueInfo(game_type=ARENA), tier_info=Tier(tier=None, division=None, lp=None), win=None, lose=None)
Most Champions       (ChampStats) | [List (5)]
                                  | ChampionStats(champion=Champion(name=Pyke), win=1 / lose=2 (winrate: 33.33%), kda=1.62)
                                  | ChampionStats(champion=Champion(name=Morgana), win=1 / lose=1 (winrate: 50.0%), kda=3.85)
                                  | ChampionStats(champion=Champion(name=Blitzcrank), win=1 / lose=0 (winrate: 100.0%), kda=4.25)
                                  | ChampionStats(champion=Champion(name=Zed), win=1 / lose=0 (winrate: 100.0%), kda=10.5)
                                  | ChampionStats(champion=Champion(name=Gangplank), win=0 / lose=1 (winrate: 0.0%), kda=1.67)
Recent Game Stats          (Game) | [List (10)]
                                  | Game(champion=Champion(name=Gangplank), kill=5, death=3, assist=0, position=MID, is_win=False)
                                  | Game(champion=Champion(name=Zed), kill=14, death=2, assist=7, position=MID, is_win=True)
                                  | Game(champion=Champion(name=Morgana), kill=7, death=10, assist=24, position=SUPPORT, is_win=False)
                                  | Game(champion=Champion(name=Pyke), kill=4, death=6, assist=4, position=SUPPORT, is_win=False)
                                  | Game(champion=Champion(name=Blitzcrank), kill=2, death=4, assist=15, position=SUPPORT, is_win=True)
                                  | Game(champion=Champion(name=Morgana), kill=3, death=3, assist=16, position=SUPPORT, is_win=True)
                                  | Game(champion=Champion(name=Zed), kill=8, death=0, assist=5, position=MID, is_win=True)
                                  | Game(champion=Champion(name=Pyke), kill=5, death=9, assist=7, position=SUPPORT, is_win=False)
                                  | Game(champion=Champion(name=Zed), kill=13, death=5, assist=5, position=MID, is_win=False)
                                  | Game(champion=Champion(name=Pyke), kill=10, death=4, assist=12, position=SUPPORT, is_win=True)
```

## Join the Discussion
Here's a link to the [Support Discord](https://discord.gg/fzRK2Sb)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ShoobyDoo/OPGG.py",
    "name": "opgg.py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.11",
    "maintainer_email": null,
    "keywords": "opgg, league-of-legends, web-scraping, summoner, data, riot-api",
    "author": "ShoobyDoo",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c5/d8/a35926c9960993e84c49d93f1a1953aa03cb31f0a0e940b2f5602148a30e/opgg_py-1.3.0.tar.gz",
    "platform": null,
    "description": "[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FShoobyDoo%2FOPGG.py&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23DDDDDD&title=visits&edge_flat=false)](https://hits.seeyoufarm.com)\r\n\r\n# OPGG.py\r\nAn unofficial Python library for accessing OPGG data.\r\n#### You can view the current active developments on the [OPGG.py Project](https://github.com/users/ShoobyDoo/projects/2) page\r\n\r\n## Prerequisites\r\n\r\n* [Python 3.11](https://www.python.org/downloads/) \r\n    \r\n    *Note: Will likely work on versions slightly older or newer*\r\n\r\n## Installation\r\n\r\n### Automatic\r\n\r\nThis library is available as a [pip package](https://pypi.org/project/opgg.py/) and can be installed via the following command:\r\n```\r\npy -m pip install opgg.py\r\n```\r\n\r\n### Manual\r\n\r\n#### Dependencies\r\n* [requests](https://pypi.org/project/requests/)\r\n* [beautifulsoup4](https://pypi.org/project/beautifulsoup4/)\r\n\r\nAlternatively, you can use the provided requirements.txt to install the required libraries by running the following command: <br>\r\n```\r\npy -m pip install -r requirements.txt\r\n```\r\n\r\n## Usage / Basic Example\r\n\r\n### Importing the library\r\n```python\r\nfrom opgg.opgg import OPGG\r\nfrom opgg.summoner import Summoner\r\n\r\n\r\ndef main():    \r\n    opgg = OPGG()\r\n    \r\n    summoner: Summoner\r\n    for summoner in opgg.search([\"ColbyFaulkn1\"]):\r\n        print(summoner)\r\n        \r\n    \r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n\r\n### Output\r\n**Important Note:** The information returned below is a summary view with the most important parts of each object shown \"at a glance\". \r\nMany of the objects have several additional properties that can be accessed by referencing the object in code.\r\n```\r\n[Summoner: ColbyFaulkn1]\r\n--------------------------------------------------------------------------------\r\nId                          (int) | 113462497\r\nSummoner Id                 (str) | h7UNeo4aQz9Rnc0FKlKvgrEgEFEoJxHMLN7oMAGvrsFI2l9Mk0-eWe1yKg\r\nAccount Id                  (str) | Qw7zgbaE-iIsC_n4VhtWXY83u0f21TQL2e6xi2Z-bYAm8KiQIFafhPfb\r\nPuuid                       (str) | k-CwhMDDAwLZYjLMcehGbvFoNsPm4HyvWqWHmkyrgX91vZtUbUDvTPaCkiPoVpPx_SjRVW8RU8Hx0g\r\nName                        (str) | ColbyFaulkn1\r\nInternal Name               (str) | colbyfaulkn1\r\nProfile Image Url           (str) | https://opgg-static.akamaized.net/meta/images/profile_icons/profileIcon907.jpg\r\nLevel                       (int) | 45\r\nUpdated At             (datetime) | 2023-08-20T07:26:15+09:00\r\nRenewable At           (datetime) | 2023-08-20T07:28:15+09:00\r\nPrevious Seasons     (SeasonInfo) | [List (1)]\r\n                                  | Season(season=SeasonInfo(display_value=2023, is_preseason=False), tier_info=Tier(tier=SILVER, division=1, lp=1))\r\nLeague Stats        (LeagueStats) | [List (3)]\r\n                                  | LeagueStats(queue_info=QueueInfo(game_type=SOLORANKED), tier_info=Tier(tier=SILVER, division=2, lp=64), win=3, lose=3)\r\n                                  | LeagueStats(queue_info=QueueInfo(game_type=FLEXRANKED), tier_info=Tier(tier=None, division=None, lp=None), win=1, lose=1)\r\n                                  | LeagueStats(queue_info=QueueInfo(game_type=ARENA), tier_info=Tier(tier=None, division=None, lp=None), win=None, lose=None)\r\nMost Champions       (ChampStats) | [List (5)]\r\n                                  | ChampionStats(champion=Champion(name=Pyke), win=1 / lose=2 (winrate: 33.33%), kda=1.62)\r\n                                  | ChampionStats(champion=Champion(name=Morgana), win=1 / lose=1 (winrate: 50.0%), kda=3.85)\r\n                                  | ChampionStats(champion=Champion(name=Blitzcrank), win=1 / lose=0 (winrate: 100.0%), kda=4.25)\r\n                                  | ChampionStats(champion=Champion(name=Zed), win=1 / lose=0 (winrate: 100.0%), kda=10.5)\r\n                                  | ChampionStats(champion=Champion(name=Gangplank), win=0 / lose=1 (winrate: 0.0%), kda=1.67)\r\nRecent Game Stats          (Game) | [List (10)]\r\n                                  | Game(champion=Champion(name=Gangplank), kill=5, death=3, assist=0, position=MID, is_win=False)\r\n                                  | Game(champion=Champion(name=Zed), kill=14, death=2, assist=7, position=MID, is_win=True)\r\n                                  | Game(champion=Champion(name=Morgana), kill=7, death=10, assist=24, position=SUPPORT, is_win=False)\r\n                                  | Game(champion=Champion(name=Pyke), kill=4, death=6, assist=4, position=SUPPORT, is_win=False)\r\n                                  | Game(champion=Champion(name=Blitzcrank), kill=2, death=4, assist=15, position=SUPPORT, is_win=True)\r\n                                  | Game(champion=Champion(name=Morgana), kill=3, death=3, assist=16, position=SUPPORT, is_win=True)\r\n                                  | Game(champion=Champion(name=Zed), kill=8, death=0, assist=5, position=MID, is_win=True)\r\n                                  | Game(champion=Champion(name=Pyke), kill=5, death=9, assist=7, position=SUPPORT, is_win=False)\r\n                                  | Game(champion=Champion(name=Zed), kill=13, death=5, assist=5, position=MID, is_win=False)\r\n                                  | Game(champion=Champion(name=Pyke), kill=10, death=4, assist=12, position=SUPPORT, is_win=True)\r\n```\r\n\r\n## Join the Discussion\r\nHere's a link to the [Support Discord](https://discord.gg/fzRK2Sb)\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An unofficial Python library for scraping/accessing data from OP.GG",
    "version": "1.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/ShoobyDoo/OPGG.py/issues",
        "Homepage": "https://github.com/ShoobyDoo/OPGG.py",
        "Source": "https://github.com/ShoobyDoo/OPGG.py"
    },
    "split_keywords": [
        "opgg",
        " league-of-legends",
        " web-scraping",
        " summoner",
        " data",
        " riot-api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cfd9e81d646ab3be3e071e569cd283ef88fad7729585ec24eac8396fd23f0114",
                "md5": "e7fd87cc1cbe73c319f68eb904884e51",
                "sha256": "f6ad728c870bc86d4e6ff1ad04a42e9fe8dd77444d98a0a73f849f28f0704cfb"
            },
            "downloads": -1,
            "filename": "opgg.py-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7fd87cc1cbe73c319f68eb904884e51",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.11",
            "size": 26362,
            "upload_time": "2024-04-29T06:37:34",
            "upload_time_iso_8601": "2024-04-29T06:37:34.996450Z",
            "url": "https://files.pythonhosted.org/packages/cf/d9/e81d646ab3be3e071e569cd283ef88fad7729585ec24eac8396fd23f0114/opgg.py-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5d8a35926c9960993e84c49d93f1a1953aa03cb31f0a0e940b2f5602148a30e",
                "md5": "ae46a6718b1ffb560745e9758c093d3e",
                "sha256": "8714cc5025a0c1e76f7cb6ad0d08b068bc5ec7326f5ee2ab09d2788ed103b898"
            },
            "downloads": -1,
            "filename": "opgg_py-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ae46a6718b1ffb560745e9758c093d3e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.11",
            "size": 25681,
            "upload_time": "2024-04-29T06:37:36",
            "upload_time_iso_8601": "2024-04-29T06:37:36.684053Z",
            "url": "https://files.pythonhosted.org/packages/c5/d8/a35926c9960993e84c49d93f1a1953aa03cb31f0a0e940b2f5602148a30e/opgg_py-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 06:37:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ShoobyDoo",
    "github_project": "OPGG.py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "opgg.py"
}
        
Elapsed time: 0.23943s