Skip to content
Leonhard S edited this page Jan 23, 2019 · 14 revisions

Auraxium Wiki

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.

Table of contents

Introduction 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.

Appetizers

Before you read on, you might want to browse a selection of code snippets:

Basic query

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())

Advanced query

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())

Getting started

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.

Clone this wiki locally