Conreality Software Development Kit (SDK) for Python

The Conreality SDK for Python is currently at an early development stage at: https://github.com/conreality/conreality.py

Note

Pending the release of a Conreality SDK for Python, you can integrate Python software with Conreality games by issuing SQL commands over the PostgreSQL network protocol (e.g., via the Psycopg2 or asyncpg libraries). Refer to the documentation for the Conreality SDK for SQL.

Prerequisites

Examples

Connecting to the Master

#!/usr/bin/env python3

import conreality.sdk as sdk
import os

DBNAME = os.getenv('USER') or 'test'

client = sdk.Client(database=DBNAME)

print(client)

Connecting to the Master (without the SDK)

#!/usr/bin/env python3

import asyncio
import asyncpg
import os

DBNAME = os.getenv('USER') or 'test'

async def run():
  conn = await asyncpg.connect(database=dbname)
  answer = await conn.fetch('''SELECT 42''')
  print(answer)
  await conn.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(run())

Installation

https://pypi.python.org/pypi/conreality

$ pip3 install conreality

Overview

Inheritance diagram of AsyncClient, Client, Session Inheritance diagram of Binary, Event, Message Inheritance diagram of Asset, Camera, Object, Player, Theater

Reference

import conreality.sdk as sdk
class conreality.sdk.Asset
class conreality.sdk.Binary
class conreality.sdk.Camera
class conreality.sdk.AsyncClient
class conreality.sdk.Client
class conreality.sdk.Event
class conreality.sdk.Message
class conreality.sdk.Object
class conreality.sdk.Player
class conreality.sdk.Session
class conreality.sdk.Theater

Frequently Asked Questions (FAQ)

How can I help contribute to the development of the Python SDK?

See https://github.com/conreality/conreality.py

Does the Python SDK also support Python 3.4?

No, as the third-party dependencies we rely on (specifically, asyncpg) require Python 3.5 at minimum.

Does the Python SDK also support Python 2.7?

No, the Conreality SDK for Python targets exclusively Python 3.5 (which was released in 2015) and newer versions of Python 3.

In case you cannot migrate from Python 2 to Python 3, we suggest integrating your legacy Python software with Conreality games by issuing SQL commands over the PostgreSQL network protocol (e.g., via the Psycopg2 library). Refer to the documentation for the Conreality SDK for SQL.