A Python client library for the ESO Logs API v2
Project description
ESO Logs Python Client
A comprehensive Python client library for the ESO Logs API v2. This library provides both synchronous and asynchronous interfaces to access Elder Scrolls Online combat logging data, with built-in support for data transformation and analysis.
Project Status
| Metric | Status |
|---|---|
| Current Version | 0.2.0-alpha |
| API Coverage | ~83% (comprehensive analysis shows 6/8 API sections fully implemented) |
| Development Stage | Active development |
| Documentation | Read the Docs |
| Tests | 278 tests across unit, integration, documentation, and sanity suites |
Current API Coverage
Implemented (6/8 sections):
- ✅ gameData - 13 methods
- ✅ characterData - 5 methods
- ✅ reportData - 9 methods
- ✅ worldData - 4 methods
- ✅ rateLimitData - 1 method
- 🟡 guildData - 2 methods (PARTIAL - missing 4 advanced methods)
Missing (2/8 sections):
- ❌ userData - 0/3 methods (MISSING - requires user auth)
- ❌ progressRaceData - 0/1 method (MISSING - niche racing feature)
Roadmap
- 🚧 Progress race tracking
- 🚧 User account integration
- 🚧 Client architecture refactor (modular design)
Installation
# Install from PyPI (recommended)
pip install esologs-python
# For development or latest features
pip install git+https://github.com/knowlen/esologs-python.git@main
Development Installation
# Clone for development
git clone https://github.com/knowlen/esologs-python.git
cd esologs-python
pip install -e ".[dev]"
API Setup
-
Create an ESO Logs API Client
- Visit ESO Logs API Clients
- Create a new v2 client application
- Note your Client ID and Client Secret
-
Set Environment Variables
export ESOLOGS_ID="your_client_id_here" export ESOLOGS_SECRET="your_client_secret_here"
-
Alternative: Use .env file
# Create .env file in your project root echo "ESOLOGS_ID=your_client_id_here" >> .env echo "ESOLOGS_SECRET=your_client_secret_here" >> .env
Quickstart
For comprehensive documentation, visit esologs-python.readthedocs.io
Basic Usage
import asyncio
from esologs.client import Client
from access_token import get_access_token
async def main():
# Get authentication token
token = get_access_token()
# Create client
async with Client(
url="https://www.esologs.com/api/v2/client",
headers={"Authorization": f"Bearer {token}"}
) as client:
# Get character information
character = await client.get_character_by_id(id=12345)
print(f"Character: {character.character_data.character.name}") # noqa: T201
# Get recent reports for character
reports = await client.get_character_reports(character_id=12345, limit=10)
for report in reports.character_data.character.recent_reports.data:
print(f"Report: {report.code} - {report.zone.name}") # noqa: T201
# Get game data
abilities = await client.get_abilities(limit=50, page=1)
for ability in abilities.game_data.abilities.data:
print(f"Ability: {ability.name}") # noqa: T201
# Run the async function
asyncio.run(main())
Authentication Only
from access_token import get_access_token
# Using environment variables
token = get_access_token()
# Using explicit credentials
token = get_access_token(
client_id="your_client_id",
client_secret="your_client_secret"
)
Character Rankings (NEW)
import asyncio
from esologs.client import Client
from esologs.enums import CharacterRankingMetricType, RoleType
from access_token import get_access_token
async def main():
token = get_access_token()
async with Client(
url="https://www.esologs.com/api/v2/client",
headers={"Authorization": f"Bearer {token}"}
) as client:
# Get character encounter rankings with filtering
encounter_rankings = await client.get_character_encounter_rankings(
character_id=12345,
encounter_id=27,
metric=CharacterRankingMetricType.dps,
role=RoleType.DPS,
difficulty=125
)
# Get zone-wide character leaderboards
zone_rankings = await client.get_character_zone_rankings(
character_id=12345,
zone_id=1,
metric=CharacterRankingMetricType.playerscore
)
# Access ranking data
if encounter_rankings.character_data.character.encounter_rankings:
rankings_data = encounter_rankings.character_data.character.encounter_rankings
print(f"Best DPS: {rankings_data.get('bestAmount', 0)}")
print(f"Total Kills: {rankings_data.get('totalKills', 0)}")
asyncio.run(main())
Advanced Report Search (NEW)
import asyncio
from esologs.client import Client
from access_token import get_access_token
async def main():
token = get_access_token()
async with Client(
url="https://www.esologs.com/api/v2/client",
headers={"Authorization": f"Bearer {token}"}
) as client:
# Search reports with flexible criteria
reports = await client.search_reports(
guild_id=123,
zone_id=456,
start_time=1672531200000, # Jan 1, 2023
end_time=1672617600000, # Jan 2, 2023
limit=25,
page=1
)
# Convenience methods for common searches
guild_reports = await client.get_guild_reports(
guild_id=123,
limit=50
)
user_reports = await client.get_user_reports(
user_id=789,
zone_id=456,
limit=20
)
# Process search results
if reports.report_data and reports.report_data.reports:
for report in reports.report_data.reports.data:
print(f"Report: {report.code} - {report.zone.name}")
print(f"Duration: {report.end_time - report.start_time}ms")
asyncio.run(main())
Available API Methods
Game Data
get_ability(id)- Get specific ability informationget_abilities(limit, page)- List abilities with paginationget_class(id)- Get character class informationget_classes(faction_id, zone_id)- List character classesget_factions()- Get available factionsget_item(id)- Get specific item informationget_items(limit, page)- List items with paginationget_item_set(id)- Get item set informationget_item_sets(limit, page)- List item sets with paginationget_map(id)- Get map informationget_maps(limit, page)- List maps with paginationget_npc(id)- Get NPC informationget_npcs(limit, page)- List NPCs with pagination
Character Data
get_character_by_id(id)- Get character profileget_character_reports(character_id, limit)- Get character's reportsget_character_encounter_ranking(character_id, encounter_id)- Get character rankings (legacy)get_character_encounter_rankings(character_id, encounter_id, **kwargs)- NEW: Advanced encounter rankings with full filteringget_character_zone_rankings(character_id, zone_id, **kwargs)- NEW: Zone-wide character leaderboards
Guild Data
get_guild_by_id(guild_id)- Get guild information
World Data
get_world_data()- Get comprehensive world informationget_regions()- Get available regionsget_zones()- Get available zonesget_encounters_by_zone(zone_id)- Get encounters in specific zone
Report Data
get_report_by_code(code)- Get specific report by codeget_reports(**kwargs)- NEW: Advanced report search with comprehensive filteringsearch_reports(**kwargs)- NEW: Flexible report search with multiple criteriaget_guild_reports(guild_id, **kwargs)- NEW: Convenience method for guild reportsget_user_reports(user_id, **kwargs)- NEW: Convenience method for user reportsget_report_events(code, **kwargs)- Get event-by-event combat log data with comprehensive filteringget_report_graph(code, **kwargs)- Get time-series performance graphs and metricsget_report_table(code, **kwargs)- Get tabular analysis data with sorting and filteringget_report_rankings(code, **kwargs)- Get report rankings and leaderboard dataget_report_player_details(code, **kwargs)- Get detailed player performance data from reports
System
get_rate_limit_data()- Check API usage and rate limits
Development
Setup Development Environment
# Clone and install
git clone https://github.com/knowlen/esologs-python.git
cd esologs-python
# Production installation
pip install -e .
# Development installation with all tools
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest tests/
Code Quality Tools
This project uses several tools to maintain code quality:
- Black: Code formatting
- isort: Import sorting
- Ruff: Fast Python linting
- MyPy: Static type checking
- pytest: Testing framework
- pre-commit: Git hooks for code quality
Project Structure
esologs-python/
├── esologs/ # Main package
│ ├── client.py # Main client implementation
│ ├── async_base_client.py # Base async GraphQL client
│ ├── exceptions.py # Custom exceptions
│ ├── validators.py # Parameter validation utilities
│ └── get_*.py # Generated GraphQL query modules
├── tests/ # Test suite (278 tests)
│ ├── unit/ # Unit tests (76 tests)
│ ├── integration/ # Integration tests (85 tests)
│ ├── docs/ # Documentation tests (98 tests)
│ └── sanity/ # Sanity tests (19 tests)
├── docs/ # Documentation source
├── access_token.py # OAuth2 authentication
├── schema.graphql # GraphQL schema
├── queries.graphql # GraphQL queries
├── pyproject.toml # Project configuration
└── README.md # This file
API Reference
GraphQL Schema
The complete GraphQL schema is available at: https://www.esologs.com/v2-api-docs/eso/
Rate Limiting
- The ESO Logs API uses rate limiting based on points per hour
- Use
get_rate_limit_data()to check your current usage - The client includes automatic retry logic for rate limit errors
Data Models
All API responses are validated using Pydantic models for type safety and data validation.
Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Install dependencies (
pip install -e ".[dev]") - Make your changes
- Run tests (
pytest) - Run code quality checks (
pre-commit run --all-files) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Roadmap
- Phase 1 ✅: Security fixes and foundation improvements
- Phase 2 🚧: Core architecture and missing API functionality
- ✅ PR #1: Character Rankings Implementation (Merged)
- ✅ PR #2: Report Analysis Implementation (Merged)
- ✅ PR #3: Integration Test Suite (Merged)
- ✅ PR #4: Advanced Report Search (Merged)
- 🚧 PR #5: Client Architecture Refactor (Next)
- Phase 3 🚧: Data transformation and pandas integration
- Phase 4 ✅: Comprehensive testing and documentation (278 tests)
- Phase 5 🚧: Performance optimization and caching
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
- ESO Logs for providing the API
- ariadne-codegen for GraphQL code generation
- The Elder Scrolls Online community
Support
- Issues: GitHub Issues
- Documentation: Read the Docs
- ESO Logs API: Official Documentation
Note: This library is not officially affiliated with ESO Logs or ZeniMax Online Studios.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file esologs_python-0.2.0a1.tar.gz.
File metadata
- Download URL: esologs_python-0.2.0a1.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3513fc9cecaffe7f071351804758ab7af8114a50f6d0aa54c3b9b8c70dbdaac
|
|
| MD5 |
552934e4b8f3ca4ca51f294da11ac516
|
|
| BLAKE2b-256 |
aeabead9949803f2351fae0f0ace8e7297e9632582e8e486d37552d801665bfc
|
File details
Details for the file esologs_python-0.2.0a1-py3-none-any.whl.
File metadata
- Download URL: esologs_python-0.2.0a1-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f09848f9547d56f46827f17f45749148e3938b11ab45e913c33a01d5039567b2
|
|
| MD5 |
49be61743ce4d05f52b8b77da6eecfed
|
|
| BLAKE2b-256 |
4d796201d5ee2e3cafc012b957c3d159b5194cd283aea473d918f5474c030263
|