Skip to main content

LPDB_python

CI PyPI - Version Code style: black GitHub License

LPDB_python provides Python interfaces for the Liquipedia Database API (LPDB API).

What You Need

  • Python 3.12 or later
  • API key for LPDB
  • (Optional) aiohttp

Installation

pip install lpdb_python

Basic Uses

LPDB Session

Python wrapper for LPDB session is defined in session.py. The wrapper provides the following differences from making your own requests:

  • Type hints

  • Validation of data type names being requested
    If an invalid data type is supplied, then the session will raise ValueError before attempting to make a request.

  • Error / warning handling
    If an error is returned by LPDB, then they will be converted to and raised as a Python exception.

  • Pre-configured request header, including formatting of your API key in the request header

    import lpdb_python as lpdb
    
    # These are equivalent
    session = lpdb.LpdbSession("your_lpdb_api_key")
    session = lpdb.LpdbSession("Apikey your_lpdb_api_key")
    

Async Session

Asynchronous implementation of LPDB session can be found in async_session/session.py. This implementation depends on aiohttp, which can be installed with this library with the following command:

pip install lpdb_python[async]

LPDB Data Types

Data types in LPDB can be found in https://liquipedia.net/commons/Help:LiquipediaDB.

The raw data returned from LPDB may not be in the corresponding Python types. To help easily access the data, defs.py file provides wrappers for each available data types that offers converted data as object properties.

A property provided by the wrapper may be None if the raw data passed to the constructor of the wrapper did not contain the data, or if it contained an empty string. Thus, the user should be checking for None where appropriate.

Example

import lpdb_python as lpdb

session = lpdb.LpdbSession("your_lpdb_api_key")

matches = [
    lpdb.Match(lpdb_raw_match)
    for lpdb_raw_match in session.make_request(
        "match",
        "leagueoflegends",
        conditions="[[parent::World_Championship/2025]]",
        streamurls="true",
    )
]

Documentation

Documentation for this package can be found in GitHub Pages.

License

This library is licensed under the MIT License, unless otherwise stated in the header of a file.
It should be noted, however, that the data you will be fetching from LPDB API is licensed under CC BY-SA 3.0. See Liquipedia API Terms of Use here.

Disclaimer

"Liquipedia" is a registered trademark of Team Liquid. Liquipedia does not endorse or sponsor this project.

Metadata

Release files for lpdb_python 0.2.2

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

Source distribution (sdist)

Source distribution for lpdb_python 0.2.2
File Size Uploaded
lpdb_python-0.2.2.tar.gz 36.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lpdb_python 0.2.2
File Interpreter ABI Platform
lpdb_python-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 49.0 kB

Release files / lpdb_python-0.2.2.tar.gz

Download URL lpdb_python-0.2.2.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d20c98f9c994a49c9c3835b06a42bbf24c4bfe85e8d23a09c00cb65a2898d800
BLAKE2b-256 checksum
How to use checksums
b9785139d8f6748e894f4689470ecb426e03339d885838349abe546ba2dea32c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lpdb_python-0.2.2-py3-none-any.whl

Download URL lpdb_python-0.2.2-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb36d08b12c5516d77d16ad78ab64333426487228abb66f7296e71038925e0a
BLAKE2b-256 checksum
How to use checksums
125b68e6517c70690442ec3f0e30eef801e22affb9e0a992c27996d88d42cdba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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