Skip to main content

No project description provided

Project description

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.

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

lpdb_python-0.2.2.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lpdb_python-0.2.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file lpdb_python-0.2.2.tar.gz.

File metadata

  • Download URL: lpdb_python-0.2.2.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for lpdb_python-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d20c98f9c994a49c9c3835b06a42bbf24c4bfe85e8d23a09c00cb65a2898d800
MD5 f104be2f50caca9608b16ec187817e82
BLAKE2b-256 b9785139d8f6748e894f4689470ecb426e03339d885838349abe546ba2dea32c

See more details on using hashes here.

File details

Details for the file lpdb_python-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: lpdb_python-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for lpdb_python-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cb36d08b12c5516d77d16ad78ab64333426487228abb66f7296e71038925e0a
MD5 fcbb0a2aa6dc2f1b207dad0ac0725204
BLAKE2b-256 125b68e6517c70690442ec3f0e30eef801e22affb9e0a992c27996d88d42cdba

See more details on using hashes here.

Supported by

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