Python SDK for Justice Augment
Project description
Justice Augment Python SDK
Python SDK for Justice Augment Project.
Development Setup
Set these local environment variables:
IAM_CLIENT_ID
- IAM client idIAM_CLIENT_SECRET
- IAM client secretADMIN_USERNAME
- (optional) user/admin usernameADMIN_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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file justice-augment-python-sdk-0.3.1.tar.gz
.
File metadata
- Download URL: justice-augment-python-sdk-0.3.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a329722d72e693680425d81e5023cb3e42a6b06d8e7fcf1786e9a6a45a74e188 |
|
MD5 | 7ffc730266825aec86d59c1e876e572d |
|
BLAKE2b-256 | 921da2464e5116a138e3bb5f7b1303cf40292df923d23b3e957872d2a50388a9 |
File details
Details for the file justice_augment_python_sdk-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: justice_augment_python_sdk-0.3.1-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af87bc8ac46f4d301b3aeae29572dd6583926f4c56eac003b7ede04ec8138970 |
|
MD5 | a9999184c576d6608a8b8cf65fc496ca |
|
BLAKE2b-256 | e230e6386cb4e8fb4fb789dba5261e45d147426eb571b436c712d9f79718b315 |