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.
Auraxium's goal is to facilitate the use of the API without compromising functionality. This is achieved by first instantiating an object representing the query to perform, which then generates the URL required.
This functionality is available for all games that support the original Census API.
For PlanetSide 2, it additionaly provides a client for the PlanetSide 2 Event Streaming Service (ESS).
This section provides basic usage examples for the API wrapper. For a proper how-to and detailed examples, check out to the Auraxium wiki instead. The following snippets are only meant to showcase the syntax.
Note: Testing for namespaces other than ps2
(i.e. PlanetSide 2, PC version) has been either extremely basic or simply non-existant. If you would like to expand the current tests to cover other games or namespaces, do feel free to contribute.
Requests are defined by instantiating a Query
object and passing it the collection to access, as well as the game namespace to use, like ps2
, dcuo
or eq2
.
Any remaining keyword arguments will be interpreted as field/value pairs to pass to the query. To generate the URL and retrieve the response, use the Query.get()
method.
import auraxium
# Retrieve and print the PlanetSide 2 weapon with the ID "22"
my_query = auraxium.Query('weapon', namespace='ps2', weapon_id='22')
print(my_query.get())
Note: Double-underscores will be interpreted as dots, which can be used to access subkeys in your queries. See the next section for an example.
Query commands like c:sort
or c:join
are represented through methods of the Query
object.
To illustrate, the following is a compound query that retrieves a weapon by name, which requires two nested joins to achieve in a single request:
import auraxium
# Get the weapon's item by name
my_query = auraxium.Query('item', namespace='ps2', name__en='^Orion')
# Attach the intermediate query to the item
my_join = my_query.join('item_to_weapon', on='item_id', to='weapon_id')
# Attach an inner query to the intermediate one
my_join.join('weapon', on='weapon_id', to='weapon_id')
# Generate the URL and return the response
print(my_query.get())
If you found a bug or would like to suggest a new feature, feel free to create an issue.
That said, while I am passionate about this project, the amount of time I can dedicate to it is limited. So if you are the coding type, feel free to just fork away and see how things go. ๐