Skip to main content

lol-stats

Python script to find your League of Legends ranked statistics across all of your accounts. This script finds your all time ranked statistics (Season 1 to Season 13) across all of your accounts and merges them. You will see your:

  • Total Games
  • Total Wins
  • Total Loses
  • Win rate
  • Average kills
  • Average deaths
  • Average assists
  • Average KDA
  • Average gold
  • Average CS
  • Most kills in game
  • Most deaths in a game
  • Total double,triple, quadra and penta kills
  • Average damage dealt
  • Average damage received

for each champion and a grand total.

Installation

pip install lol-stats

Google Chrome must be installed on your system. The program automatically installs ChromeDriver binaries required for Selenium web scrapping.

Usage

Lauch the program:

import lol_stats

lol_stats.launch()

In console you'll see that the program is launched. Go to http://localhost:8126 from a browser to interact with the program.

To run the program on a different port, you pass an optional argument to launch() function:

lol_stats.launch(port=1234)
  • Enter all of your LOL accounts and their servers (euw, na, tr, kr etc.) and press "Submit". You can submit without any account to see an example result (Faker's account "Hide on bush" 😀)
  • Now you should see "Gathering data for x accounts" and the program is working. You can see the progress in Python program's console. Each time a season data for an account is fetched, it is printed to the console. The program should usually take 20-60 seconds.
  • Upon completion, you'll see the results in your browser. You can also download them using the "Download CSV" button. Python will automatically download it as result.csv for your convenience.
  • If you want to rerun it for different accounts, refresh the browser.

Note: The program is multithreaded to process multiple accounts as quickly as possible. This may cause high CPU and RAM usage, which is normal.

Example Output

How it works

The program uses Selenium for web scrapping. It opens Google Chrome in background, visits op.gg page for each account and scrapes the data. Since op.gg doesn't provide an API for fast data retrieval, the only option is physically visiting it from browser. This is why the program is resource-intensive and can take some time.

Notes

  • The program fetches data from op.gg. If op.gg is unavailable the program won't work. If the data on op.gg is wrong so will be the program's results.

  • Sometimes it takes long for op.gg to respond. In that case you may need to wait for 5-10 minutes, or you can try again later. Track the progress from Python console, it should print the progress like:

Data for accounts:
https://www.op.gg/summoners/kr/hide%20on%20bush/champions
started processing
installing chromedriver
installed chromedriver
concurrent execution
started https://www.op.gg/summoners/kr/hide%20on%20bush/champions
Page is fully loaded.
time=  0.1226658821105957 seconds
1
hide_on_bush
Recorded Season 2023 S2 for https://www.op.gg/summoners/kr/hide%20on%20bush/champions
time=  0.705498218536377 seconds
2
hide_on_bush
Recorded Season 2023 S1 for https://www.op.gg/summoners/kr/hide%20on%20bush/champions
time=  0.6393542289733887 seconds
...
--- 18.60 seconds ---
ENDED !

Contact

Raise an issue on the GitHub repo: https://github.com/atahanuz/lol-stats/

Metadata

Release files for lol-stats 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lol-stats 1.0.1
File Size Uploaded Provenance
lol-stats-1.0.1.tar.gz 40.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lol-stats 1.0.1
File Interpreter ABI Platform
lol_stats-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 80.0 kB

Release files / lol-stats-1.0.1.tar.gz

Download URL lol-stats-1.0.1.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a730bc99d767d7992eb000591f953acb493b00ce9b61bd989e20ef72e78e7efc
BLAKE2b-256 checksum
How to use checksums
73e5c7a792b4d019202a7ebdcb2edd5f35f4a6199431e618899cbdb38218ffbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / lol_stats-1.0.1-py3-none-any.whl

Download URL lol_stats-1.0.1-py3-none-any.whl
Size 39.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
097369b03913b090ce084edca130e2043c6216a220c74a66fe52dce5b3605d77
BLAKE2b-256 checksum
How to use checksums
c1cc9e9bbd1dc18d6ef4371e7e9058899e2813246f963bcec680d039d12d050e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for lol-stats 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page