-
Notifications
You must be signed in to change notification settings - Fork 2
Home
GitHub Action Wiki Bot edited this page Jun 26, 2026
·
8 revisions
The warera-client is a robust, type-safe Python SDK for the WarEra Game API. It features extreme throughput optimizations, smart caching, and native Pydantic integrations to make building bots and analytical tools a breeze.
pip install warera-clientYou don't need to manually instantiate a client class for basic usage. The library exposes a global API that handles connection pooling under the hood.
import asyncio
import warera
async def main():
# Fetch a single user by ID
user = await warera.user.get_by_id("123")
print(f"User Name: {user.name}")
# Fetch multiple users in an automated batch request
users = await warera.user.get_many(["1", "2", "3"])
print(f"Loaded {len(users)} users efficiently.")
if __name__ == "__main__":
asyncio.run(main())If you need to configure the underlying HTTP session, retry logic, or concurrency limits, you can construct a custom WareraClient and use it as a context manager:
import asyncio
from warera import WareraClient
async def main():
# Pass custom configuration here
async with WareraClient(max_retries=3) as client:
company = await client.company.get("100")-
Auto-Batching: Any
.get_many()call is automatically chunked into optimized batch requests of 50 procedures each, drastically reducing round-trip latency. -
Smart Caching: Heavy endpoints like
game_configare cached in memory and served instantly using a Stale-While-Revalidate pattern. -
Time-Slice Pagination: Grab thousands of records instantly using the
collect_all()engine.
To learn more about these powerful features, visit the Advanced Usage page!
Check out the API Reference to explore all 32 available resource namespaces and their perfectly typed models.
- action_log
- alliance
- article
- battle
- battle_loot_summary
- battle_order
- battle_ranking
- company
- country
- donation
- election
- event
- game_config
- game_stat
- government
- inventory
- item_trading
- mercenary_contract_auction
- mu
- mu_member
- party
- ranking
- region
- round
- search
- tournament
- transaction
- upgrade
- user
- work
- work_offer
- worker