Metadata-Version: 2.1
Name: xboxapi
Version: 2.0.1
Summary: XBOX One API
Home-page: https://github.com/mKeRix/xboxapi-python
Download-URL: https://github.com/mKeRix/xboxapi-python/tarball/2.0.1
Author: xapi.us
License: MIT License
Platform: any
Classifier: Programming Language :: Python
Classifier: Development Status :: 3 - Alpha
Classifier: Natural Language :: English
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Description-Content-Type: text/markdown
License-File: LICENSE

# Description #

This is a Python wrapper for the unofficial [Xbox API](https://xboxapi.com)

[![Build Status](https://travis-ci.org/xboxapi/Python-Wrapper.svg?branch=master)](https://travis-ci.org/xboxapi/Python-Wrapper)

# 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](https://github.com/kennethreitz/requests) library.

# Usage #

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

```python
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](https://xboxapi.com)    |
| 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.
