Skip to main content

poe-client

Build Status codecov Python Version wemake-python-styleguide

Async PoE API client with rate limit support.

Updated for Scourge League.

WARNING

This project is in an pre-alpha stage and has not been tested properly in production. Use with caution.

Features

  • Asynchronous HTTP client based on aiohttp
  • Up-to-date with all PoE API endpoints
  • All PoE API types defined as Pydantic schemas (Can generate OpenAPI Specifications)
  • 100% test coverage and style enforced with wemake's flake8
  • Fully typed with pydantic and checked with mypy, PEP561 compatible

Limitations

There is no API endpoint only to fetch rate limit headers. This means that the Client is not aware of what rules exist until it makes a real request. Thus, be aware that sending too many request at the same time leads to being rate limited. Try to batch by 5, we've seen this as a safe level of concurrency.

Installation

pip install poe-client

Example

Showcase how your project can be used:

from typing import List
import os

from poe_client.client import Client, PoEClient
from poe_client.schemas.league import League

token = os.environ["POE_TOKEN"]
contact = os.environ["POE_CONTACT"]

if not token or not contact:
    raise EnvironmentError("Need to set both POE_TOKEN and POE_CONTACT")


client = PoEClient(
    token,
    "poe-client",
    "1.0",
    contact,
)

async def list_leagues():
    """List leagues."""
    leagues: List[League] = []
    async with client:
        leagues = await client.list_leagues()

    logging.info(leagues)

License

MIT

Credits

This project was generated with wemake-python-package. Current template version is: 6cb0736bbc9cb53ee126e2297b8ed7029b5e1380. See what is updated since then.

Metadata

Release files for poe-client 0.5.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 poe-client 0.5.1
File Size Uploaded
poe-client-0.5.1.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poe-client 0.5.1
File Interpreter ABI Platform
poe_client-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.8 kB

Release files / poe-client-0.5.1.tar.gz

Download URL poe-client-0.5.1.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
193db02a76b7511fbe533311ea2f1baf1fc4ec604c246c2406c03cc8bc49aa99
BLAKE2b-256 checksum
How to use checksums
4dedcc7a58ac127083089a185e53d198a493d8b3c8b4f4f19ede4b45205825c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2

Release files / poe_client-0.5.1-py3-none-any.whl

Download URL poe_client-0.5.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b0c0e37bf9c0aa9ae9598a80f6d37f91e7d2882f9e74ea8e22391248bf5bed0
BLAKE2b-256 checksum
How to use checksums
ad2aa14f4f148d4d221bc61626c4ae339802b66b3ebd18e033894bf5ead9364e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

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