Enums¶
Overview¶
Enums (Enumerations) in ESO Logs Python provide type-safe constants for various API parameters. They represent fixed sets of allowed values defined by the ESO Logs GraphQL schema, ensuring that your code uses valid options and catches errors at development time rather than runtime.
Advanced GraphQL Features
Some enums in the GraphQL schema are only used by nested fields that aren't exposed through the Python client's convenience methods. See Direct GraphQL Access for how to use these advanced features.
Why Use Enums?¶
- Type Safety: Your IDE and type checker will catch invalid values before you run your code
- Autocomplete: Get intelligent suggestions as you type, showing all valid options
- Self-Documenting: Enum names clearly indicate what values are acceptable
- Validation: The API will reject invalid values, but using enums prevents these errors entirely
Basic Usage¶
from esologs import Client, EventDataType, HostilityType
from esologs.auth import get_access_token
async def analyze_combat():
token = get_access_token()
client = Client(
url="https://www.esologs.com/api/v2/client",
headers={"Authorization": f"Bearer {token}"}
)
# Using enums for type-safe queries
events = await client.get_report_events(
code="abc123",
data_type=EventDataType.DamageDone, # ✅ Type-safe with autocomplete
hostility_type=HostilityType.Enemies # ✅ IDE will show available options
)
# String values also work but lose benefits
events2 = await client.get_report_events(
code="abc123",
data_type="DamageDone", # ⚠️ Works but no validation/autocomplete
)
Importing Enums¶
All enums are available from the main package:
from esologs import (
EventDataType,
TableDataType,
GraphDataType,
CharacterRankingMetricType,
HostilityType,
RoleType,
KillType,
# ... and more
)
Available Enums¶
CharacterRankingMetricType¶
Metrics available for character rankings and leaderboards.
Values:
bosscdps- Boss conduit DPSbossdps- Boss damage per secondbossndps- Boss normalized DPSbossrdps- Boss rDPS (raid-contributing DPS)default- Default metricdps- Damage per secondhps- Healing per secondkrsi- Kill speed indexplayerscore- Overall performance scoreplayerspeed- Clear time performancecdps- Conduit DPSndps- Normalized DPSrdps- Raid-contributing DPStankhps- Tank healing per secondwdps- Weighted DPShealercombineddps- Healer combined DPShealercombinedbossdps- Healer combined boss DPShealercombinedcdps- Healer combined conduit DPShealercombinedbosscdps- Healer combined boss conduit DPShealercombinedndps- Healer combined normalized DPShealercombinedbossndps- Healer combined boss normalized DPShealercombinedrdps- Healer combined rDPShealercombinedbossrdps- Healer combined boss rDPStankcombineddps- Tank combined DPStankcombinedbossdps- Tank combined boss DPStankcombinedcdps- Tank combined conduit DPStankcombinedbosscdps- Tank combined boss conduit DPStankcombinedndps- Tank combined normalized DPStankcombinedbossndps- Tank combined boss normalized DPStankcombinedrdps- Tank combined rDPStankcombinedbossrdps- Tank combined boss rDPS
Used by:
EventDataType¶
Types of events that can be filtered when retrieving report events.
Values:
All- All event typesBuffs- Buff application eventsCasts- Ability cast eventsCombatantInfo- Combatant informationDamageDone- Damage dealt eventsDamageTaken- Damage received eventsDeaths- Death eventsDebuffs- Debuff application eventsDispels- Dispel eventsHealing- Healing eventsInterrupts- Interrupt eventsResources- Resource changes (magicka, stamina)Summons- Pet/summon eventsThreat- Threat/aggro events
Used by:
ExternalBuffRankFilter¶
Filter for rankings based on external buff usage.
Values:
Any- Any external buff usageExclude- Exclude rankings with external buffsRequire- Only show rankings with external buffs
Used by:
Note: This enum is defined in the GraphQL schema for use with Encounter.characterRankings, which is not exposed as a top-level query method in the ESO Logs API. The Python client provides 100% coverage of available API methods.
FightRankingMetricType¶
Metrics available for fight-specific rankings.
Values:
default- Default ranking metricexecution- Execution scorefeats- Feats of strengthscore- Overall scorespeed- Clear speedprogress- Progress metric
Used by:
GraphDataType¶
Types of data available for time-series graphs.
Values:
Summary- Summary dataBuffs- Buff uptime over timeCasts- Cast timelineDamageDone- Damage output graphDamageTaken- Damage taken graphDeaths- Death timelineDebuffs- Debuff uptime over timeDispels- Dispel timelineHealing- Healing output graphInterrupts- Interrupt timelineResources- Resource levels over timeSummons- Summon timelineSurvivability- Survivability metricsThreat- Threat over time
Used by:
GuildRank¶
Guild member rank levels.
Values:
NonMember- Not a guild memberApplicant- Guild applicantRecruit- New guild memberMember- Standard memberOfficer- Guild officerGuildMaster- Guild leader
Used by:
HardModeLevelRankFilter¶
Filter for rankings based on hard mode completion.
Values:
Any- Any difficulty levelHighest- Highest difficulty onlyNormalMode- Normal mode (base difficulty)Level0- Hard mode level 0Level1- Hard mode level 1Level2- Hard mode level 2Level3- Hard mode level 3Level4- Hard mode level 4
Used by:
Note: This enum is defined in the GraphQL schema for use with Encounter.characterRankings, which is not exposed as a top-level query method in the ESO Logs API. The Python client provides 100% coverage of available API methods.
HostilityType¶
Filter events by hostility relationship.
Values:
Friendlies- Friendly targets (allies, self)Enemies- Hostile targets
Used by:
KillType¶
Filter data by encounter outcome.
Values:
All- All fight dataEncounters- All encounter attemptsKills- Successful kills onlyTrash- Trash fights onlyWipes- Failed attempts only
Used by:
LeaderboardRank¶
Leaderboard ranking tiers.
Values:
Any- Any rankLogsOnly- Logs only (no rank restrictions)
Used by:
Note: This enum is defined in the GraphQL schema for use with Encounter.characterRankings, which is not exposed as a top-level query method in the ESO Logs API. The Python client provides 100% coverage of available API methods.
RankingCompareType¶
How to compare rankings.
Values:
Rankings- Compare by rank positionParses- Compare by performance percentile
Used by:
RankingTimeframeType¶
Time period for rankings.
Values:
Today- Today's rankingsHistorical- All-time historical
Used by:
ReportRankingMetricType¶
Metrics for report-level rankings.
Values:
bossdps- Boss damage per secondbossrdps- Boss rDPSdefault- Default metricdps- Damage per secondhps- Healing per secondkrsi- Kill speed indexplayerscore- Player scorerdps- Raid-contributing DPStankhps- Tank healing per second
Used by:
RoleType¶
Character role classifications.
Values:
Any- Any roleDPS- Damage dealer roleHealer- Healer roleTank- Tank role
Used by:
SubscriptionStatus¶
User subscription status levels.
Values:
Silver- Silver subscriptionGold- Gold subscriptionPlatinum- Platinum subscriptionLegacySilver- Legacy silver statusLegacyGold- Legacy gold statusLegacyPlatinum- Legacy platinum statusAlchemicalSociety- Alchemical Society membership
Used by:
Note: This enum is defined in the GraphQL schema but is not used by any fields accessible through the ESO Logs API. The Python client provides 100% coverage of available API methods.
TableDataType¶
Types of data available in tabular format.
Values:
Summary- Summary statisticsBuffs- Buff uptime statisticsCasts- Cast counts and timingsDamageDone- Damage dealt breakdownDamageTaken- Damage taken analysisDeaths- Death logDebuffs- Debuff uptime statisticsDispels- Dispel countsHealing- Healing breakdownInterrupts- Interrupt countsResources- Resource generation/usageSummons- Summon statisticsSurvivability- Survivability statisticsThreat- Threat generation
Used by:
ViewType¶
Perspective for viewing data.
Values:
Default- Default viewAbility- Group by abilitySource- Group by sourceTarget- Group by target
Used by:
Best Practices¶
1. Always Import What You Need¶
# Good - explicit imports
from esologs import EventDataType, HostilityType
# Avoid - importing everything
from esologs import *
2. Use Enums for Type Safety¶
# Good - type-safe with IDE support
events = await client.get_report_events(
code="abc",
data_type=EventDataType.DamageDone
)
# Less ideal - no compile-time checking
events = await client.get_report_events(
code="abc",
data_type="DamageDone"
)
3. Leverage Your IDE¶
Modern IDEs will show available enum values as you type:
# Type "EventDataType." and your IDE shows:
# - EventDataType.All
# - EventDataType.Buffs
# - EventDataType.Casts
# ... etc
4. Enum Values Are Strings¶
All enum values are strings, so you can use them anywhere a string is expected: