Registry / http-networking / powerbot-client

powerbot-client

JSON →
library2.31.3pypypiunverified

The powerbot-client library provides an asynchronous Python client for interacting with the PowerBot API. It allows users to fetch market data, manage orders, and access other platform functionalities. The current version is 2.30.6 and it maintains a relatively frequent release cadence, often aligning with API updates.

pip install powerbot-client
INSTALL
IMPORT
SIG · POWERBOT-CLIENT
P
powerbot-client
http-networkingpythonv2.31.3
Install
2.2s avg
Import
—
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.31.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27.4MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 2.2s · import 0.000s · 28MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PowerBotClient
✓ from powerbot_client import PowerBotClient
✗ from powerbot_client import PowerBotClient

This quickstart initializes the PowerBotClient with an API key from an environment variable, fetches a list of markets, prints the first three, and ensures the client connection is properly closed. It demonstrates the basic asynchronous usage pattern required by the library.

import asyncio import os from powerbot_client.client import PowerBotClient from powerbot_client.models import Market async def main(): api_key = os.environ.get('POWERBOT_API_KEY', '') if not api_key: print("Error: POWERBOT_API_KEY environment variable not set.") return client = PowerBotClient(api_key=api_key) try: print("Fetching markets...") markets = await client.get_markets() for m in markets[:3]: # Print first 3 markets print(Market.model_dump(m, exclude_unset=True)) except Exception as e: print(f"An error occurred: {e}") finally: await client.close() print("Client closed.") if __name__ == "__main__": # Ensure the event loop is run properly asyncio.run(main())
Debug
Known issues
breakingVersion 2.0.0 introduced a complete rewrite of the client, making it entirely incompatible with v1.x. All imports, class names, method signatures, and data models changed significantly.
fix
Refer to the v2.0.0+ documentation and examples. A full migration of existing v1.x code is required.
affects: >=2.0.0
gotchaForgetting to `await` asynchronous methods (e.g., `client.get_markets()`, `client.close()`) will result in `TypeError: object asyncio.Future can't be used in 'await' expression` or `RuntimeWarning`.
fix
Always prepend `await` when calling methods that are `async def`.
affects: All versions
gotchaThe client uses an aiohttp session and websockets connection. Failing to call `await client.close()` can leave open connections and potentially lead to resource leaks or unexpected behavior, especially in long-running applications.
fix
Always ensure `await client.close()` is called, ideally within a `finally` block or an `async with` statement (if supported, current version uses explicit close).
affects: All versions
gotchaAttempting to call `asyncio.run()` in an environment where an event loop is already running (e.g., in some IDEs, Jupyter notebooks, or nested async contexts) will raise a `RuntimeError`.
fix
If an event loop is already running, use `asyncio.create_task()` or `loop.run_until_complete()` instead of `asyncio.run()` for new coroutines. For simple scripts, ensure `asyncio.run()` is only called once at the top level.
affects: All versions
Upgrade
Version history
2.31.3latest on PyPI · released Apr 27, 2026
Audit
Dependencies
aiohttprequiredHTTP client for making API requests.
asyncio-throttlerequiredUsed for rate-limiting API calls to prevent exceeding limits.
pydanticrequiredFor data validation and parsing API responses into models.
python-dotenvrequiredOptional: For loading environment variables (like API keys) from a .env file.
websocketsrequiredFor WebSocket connections to stream real-time data.
Agent activity
12 hits · last 30 days
node
12
Resources
powerbot-client — pip install powerbot-client · libregistry