-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Auraxium is a Python wrapper for the Daybreak Game Company Census API. While its core components have been designed to work with any title using the Census API syntax, it is mainly being developed and tested with PlanetSide 2 in mind.
Introduction Introduction Introduction
Auraxium was born out of frustrating attempts to write a Discord bot for my PlanetSide 2 outfit that would automate certain tasks like logging member activity or retrieving outfit-leaderboard information from outside the game.
It quickly became apparent that hard-coding the URLs required was unfeasible, and attempts to generate them quickly turned into unwieldy syntax abominations that were even more inconvenient than finding the typos in the URLs through trial-and-error.
The result of this quest is Auraxium, which attempts to solve this by abstracting the URL generation through objects and hiding as much of the dirty work from the user as possible.
Before you read on, you might want to browse a selection of code snippets:
The following script looks up the PlanetSide 2 faction with id 1, which happens to be the wonderful and benevolent Vanu Sovereignty.
import auraxium
print(Query('faction', namespace='ps2', faction_id='1').get())
This is an example for a less-basic query.
import auraxium
# Create the main query for the item
query = auraxium.Query('item', namespace='ps2', name__en='^Orion').lang('en')
# Attach the intermediate "item_to_weapon" collection
join = query.join('item_to_weapon', on='item_id', to='weapon_id')
# Resolve the weapon collection using the id retrieved earlier
join.join('weapon', on='weapon_id', to='weapon_id')
# Print the response
print(query.get())
If you have not used the original Census API before or just want a quick refresh, you check out the the DBG Census API primer.
This Wiki only contains general Census API topics, development notes and other version-independent documentation.
Visit Read the Docs for usage examples and the full API reference.