Giter Site home page Giter Site logo

python-wrapper's Introduction

Description

This is a Python wrapper for the unofficial Xbox API

Build Status

Installation

For now you will have to install manually, as I didn't upload the initial version to pypi (pip).

  1. Clone this repo
  2. Place the xboxapi directory in your project

The only dependency is requests library.

Usage

This is a basic example of how to create a client and fetch a gamers profile information from their gamertag.

from xboxapi import Client

client = Client(api_key=<api_key>)
gamer = client.gamer('voidpirate')

profile = gamer.get('profile')

Client class constructor takes the following optional arguments except api_key.

Argument Value Short Description
api_key string api token from Xbox API
timeout int how long until the request times out (seconds)
lang string country language code (e.g. for German (de-DE))

Client class public methods.

Method Value Optional Short Description
gamer(gamertag=<string>) string xuid=<string> gamertag to lookup
calls_remaining() n/a n/a Return headers about api rate limits

A note about the gamer method. If you already know the gamers xuid you can use that instead to avoid an additional api call when using only a gamertag.

Gamer class public methods, returned from gamer method in Client.

Method Value Optional Short Description
get(method=<string>) string term=<string> API calls.
send_message(message=<string>) string n/a Send a message to gamer
send_activity(message=<string>) string n/a Update your activity feed with a message

Pagination is supported in this client and all handled through get method. It works by detecting the response header for pagination, any subsequent calls to the same api endpoint will return paged data. If another api call is made to a different endpoint, the pagination token will be cleared and results will not be paged.

python-wrapper's People

Contributors

0verbyte avatar chadpaulson avatar darkwizz avatar jebby avatar jlax47 avatar minchinweb avatar slix69 avatar

Watchers

 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.