Giter VIP home page Giter VIP logo

auraxium's Introduction

Auraxium

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.


Overview

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

How to use

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.

Basic requests

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

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

Contributing

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. ๐Ÿ˜Š

auraxium's People

Contributors

leonhard-s avatar lordflashmeow avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.