Skip to main content

Easy-to-use wrapper for the League Client API.

Project description

LCU Connector

This library serves to make the connection with the League Client API in a simple way, although there are others, such as lcu-driver (which by the way is very good), but with lcu-driver, for example, I couldn't work and structure my code the way I wanted it to, so I decided to make my own wrapper.

Quick start

I will be brief in the explanation but I guarantee that it will be enough, as this library is simple to use. Among other things, I'm working on more elaborate documentation.

So, hand in the dough! Or rather, on the keyboard...

Installation

Just use pip and it's fine.

pip install lcu-connector

How to use

Import the Connector from the lcu_connector module, instantiate it and start the session via the .start() method or passing the start=True parameter directly in the instance.

from lcu_connector import Connector

# Method 01
conn = Connector(start=True)

# Method 02
conn = Connector()
conn.start()

Now have fun, the Connector object has the same attributes as the requests library and derivatives.

from lcu_connector import Connector

conn = Connector(start=True)

# Getting the data of the currently connected summoner
res = conn.get('/lol-summoner/v1/current-summoner')
print(res.json())

# Getting a summoner's data by name
summoner_name = 'JohnDoe'
res = conn.get('/lol-summoner/v1/summoners?name={summoner_name}')
print(res.json())

# Performing POST request
data = {
    'foo': 'bar'
}
res = conn.post('API_URL', data=data)
if res.status_code == 200:
    do_something()

conn.stop()

You can see all available links for League Client through LCU Explorer.

To-do

  • API event watcher
  • Built-in functions for commonly used tasks (like a get_summoner_by_name())
  • More detailed documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lcu-connector-1.0.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

lcu_connector-1.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file lcu-connector-1.0.1.tar.gz.

File metadata

  • Download URL: lcu-connector-1.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for lcu-connector-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8a1b9e5b295ebccf73670a1e20af1556e0a437d3cf84d1c8db0ec9c797f28946
MD5 870e036e940d422a6c05caae673cd626
BLAKE2b-256 14a52ed382531eec3c2b12726971b17b9f494fdd22883f4162258a64108c87be

See more details on using hashes here.

File details

Details for the file lcu_connector-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lcu_connector-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3601c3bc5f01bcbdb33d663dada7f8f6b99eaf6430f60703a6ac0f4623083efa
MD5 ccb095c14ea936f634c77e7ecf103af4
BLAKE2b-256 45464648b1630def2cd6b523278dbcabf29f6b37f8285c0336eda5e2655f0dcb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page