Skip to main content

A Python Rest SDK for Gameworks Services

Project description

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

$ 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:

$ pip install -r requirements-docs.txt
$ cd docs
$ sphinx-quickstart
$ make html

Installation

$ pip install gameworksrestsdkdk

Configuration and Session Creation

Create a Registry Session by importing the class from gameworksrestsdk and enter your credentials.

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.

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.

user_details = session.session_details.to_dict()

Create User Account

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

session.update_user(
  user_id=1,
  first_name='Luke',
  last_name='Skywalker',
  pk='aaaaaaaaaaeeeeeeeeeebbbbbbbbbb5555555555dddddddddd1111111111aaee',
  wallet_address='NBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D'
)

Find User Account

session.find_user(user_id=1)

Confirm User Account

session.confirm_user(confirmation_code='1111')

Resend Code

session.resend_code(user_id=1)

Create Player Profile

session.create_player(
    user_id=1, 
    username='usetheforcelukeIV'
)

Update Player Profile

session.update_player(
    user_id=1, 
    username='darthisnotmyfatherV'
)

Find Player Profile

session.find_player(user_id=1)

Create Publisher Profile

session.create_publisher(
    user_id=1,
    publisher_name='Second Order',
    description='Definitely not the First',
    wallet_address='NBLSQO7ZPBYNBDU29TE5MAKA2S3DHDCIFG775N3D'
)

Update Publisher Profile

session.update_publisher(
    user_id=1,
    publisher_name='Second Order',
    description='Definitely not the First',
    wallet_address='NBLSQO7ZPBYNBDU29TE5MAKA2S3DHDCIFG775N3D'
)

Find Publisher Profile

session.find_publisher(user_id=1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
gameworksrestsdk-1.1.0-py3-none-any.whl (15.9 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page