Skip to main content

Justice Augment Python SDK

Python SDK for Justice Augment Project.

Development Setup

Set these local environment variables:

  • IAM_CLIENT_ID - IAM client id
  • IAM_CLIENT_SECRET - IAM client secret
  • ADMIN_USERNAME - (optional) user/admin username
  • ADMIN_PASSWORD - (optional) user/admin password

Then run:

$ make build

It will create a docker image with env variables interpolated in tox.ini file for testing.

To test it, run this command:

$ make test

After that, you can cleanup the working directory with this command:

$ make clean

How to use

To use this SDK you can install it from pip with this command:

$ pip install justice-augment-python-sdk

Alternatively, you can add justice-augment-python-sdk as dependency in requirements.txt. Then you install it with this command:

$ pip install -r requirements.txt

After that you can import the package, and use it like this:

Justice package

import os
from justice import Justice


endpoint = "https://demo.accelbyte.io"
namespace = 'accelbyte'

core = Justice(namespace, endpoint)
wallet_id = 'some-wallet-string-id'
resp = core.wallet.get_wallet(wallet_id)
my_wallet = resp.json()
print("Wallet balance: {0} {1}".format(my_wallet['balance'], my_wallet['currencyCode']))

Do not forget to set IAM_CLIENT_ID and IAM_CLIENT_SECRET in your local environment variables if you want to try it in your local machine.

BuiltInDB package

from datastore import MongoDB

augment_mongoclient = MongoDB(endpoint=<INSERT_YOUR_MONGODB_URL_HERE>)
collection_name = "sample-collection"
data = {"name": "sample-name", "description": "sample-description"}
augment_mongoclient.builtin_db[collection_name].insert_one(data)
print(data)

If endpoint parameter in BuiltInDB object initializationis not set, default value pointing to AccelByte's Justice demo mongoDB will be used.

Commit Message Guidelines

We use https://www.conventionalcommits.org/ as a guidelines to write commit message. You use this format to write your commit message:

<type>(optional scope): <description>
<BLANK LINE>
<optional-body>
<BLANK LINE>
<optional-footer>

Any line of the commit message cannot be longer than 100 characters!

Samples:

docs(changelog): update changelog to beta.5
fix(login): add the missing username field

We made login system without username field in our Database!

Type

Must be one of the following:

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • test: Adding missing tests or correcting existing tests
  • chore: Repository maintenance

Release files for justice-augment-python-sdk 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for justice-augment-python-sdk 0.3.1
File Size Uploaded
justice-augment-python-sdk-0.3.1.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for justice-augment-python-sdk 0.3.1
File Interpreter ABI Platform
justice_augment_python_sdk-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.0 kB

Release files / justice-augment-python-sdk-0.3.1.tar.gz

Download URL justice-augment-python-sdk-0.3.1.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a329722d72e693680425d81e5023cb3e42a6b06d8e7fcf1786e9a6a45a74e188
BLAKE2b-256 checksum
How to use checksums
921da2464e5116a138e3bb5f7b1303cf40292df923d23b3e957872d2a50388a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / justice_augment_python_sdk-0.3.1-py3-none-any.whl

Download URL justice_augment_python_sdk-0.3.1-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af87bc8ac46f4d301b3aeae29572dd6583926f4c56eac003b7ede04ec8138970
BLAKE2b-256 checksum
How to use checksums
e230e6386cb4e8fb4fb789dba5261e45d147426eb571b436c712d9f79718b315
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page