gameworksrestsdk 1.1.0
A Python Rest SDK for Gameworks Services

# Gameworks Python SDK V1


A Software Development Kit for serving Gameworks applications and services.
The SDK currently allows you to connect to the Gameworks Registry API.


### Development Installation Instructions
``` sh
$ git clone https://github.com/gameworks-gwx/gameworks-python-sdk.git
$ cd gameworks-python-sdk
$ virtualenv venv
...
$ .venv/bin/activate
$ pip install -r requirements.txt
```

### Generating Documentation
Sphinx is used for documentation. To generate the HTML output locally:
``` sh
$ pip install -r requirements-docs.txt
$ cd docs
$ sphinx-quickstart
$ make html
```

### Installation

``` sh
$ pip install gameworksrestsdkdk
```

### Configuration and Session Creation
Create a Registry Session by importing the class from `gameworksrestsdk` and enter your credentials.

```python
from gameworksrestsdkdk import RegistrySession

session = RegistrySession(email='example@example.com', password='password')
```

By default, the SDK endpoint is directed to the staging environment. In order to change the endpoint to production, set `mode='production'` as the paramters for the Api class constructor as seen in the code block below.

```python
from gameworksrestsdk import Api

api = Api(mode='production')
session = RegistrySession(email='example@example.com', password='password', api=api)

```
### Retrieve Login Session Details
All call responses are encapsulated in a `RegistrySession` class. You may choose to access these responses as a `str` or a `dict`. 

Retrieve user details in dictionary form using the instantiated session class we created earlier.


```python
user_details = session.session_details.to_dict()

```


### Create User Account
```python
session.create_user(
  first_name='Luke', 
  last_name='Skywalker',
  wallet_address='NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D', 
  pk='aaaaaaaaaaeeeeeeeeeebbbbbbbbbb5555555555dddddddddd1111111111aaee', 
  email='luke@skywalker.com, 
  password='nooooooooooo!!!!!!???!?!!!', 
  password_confirmation='nooooooooooo!!!!!!???!?!!!'
)
```

### Update User Account
```python
session.update_user(
  user_id=1,
  first_name='Luke',
  last_name='Skywalker',
  pk='aaaaaaaaaaeeeeeeeeeebbbbbbbbbb5555555555dddddddddd1111111111aaee',
  wallet_address='NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D'
)
```

### Find User Account
```python
session.find_user(user_id=1)
```

### Confirm User Account
```python
session.confirm_user(confirmation_code='1111')
```

### Resend Code
```python
session.resend_code(user_id=1)
```

### Create Player Profile
```python
session.create_player(
    user_id=1, 
    username='usetheforcelukeIV'
)
```

### Update Player Profile
```python
session.update_player(
    user_id=1, 
    username='darthisnotmyfatherV'
)
```

### Find Player Profile
```python
session.find_player(user_id=1)
```

### Create Publisher Profile
```python
session.create_publisher(
    user_id=1,
    publisher_name='Second Order',
    description='Definitely not the First',
    wallet_address='NBLSQO7ZPBYNBDU29TE5MAKA2S3DHDCIFG775N3D'
)
```

### Update Publisher Profile
```python
session.update_publisher(
    user_id=1,
    publisher_name='Second Order',
    description='Definitely not the First',
    wallet_address='NBLSQO7ZPBYNBDU29TE5MAKA2S3DHDCIFG775N3D'
)
```

### Find Publisher Profile
```python
session.find_publisher(user_id=1)
```