Python 3 interface library for swgoh-comlink (https://github.com/swgoh-utils/swgoh-comlink)
Project description
comlink-python
Description
A python wrapper for the swgoh-comlink tool.
Installation
Install from PyPi package repository using the following shell command.
pip install swgoh_comlink
Usage
Basic default usage example:
from swgoh_comlink import SwgohComlink
comlink = SwgohComlink()
player_data = comlink.get_player(245866537)
player_name = player_data['name']
guild_id = player_data['guildId']
guild = comlink.get_guild(guild_id)
guild_name = guild['profile']['name']
Usage example with non-default settings for a swgoh-comlink service running on the local machine at TCP port 3500:
from swgoh_comlink import SwgohComlink
comlink = SwgohComlink(url='http://localhost:3500')
player_data = comlink.get_player(245866537)
player_name = player_data['name']
guild_id = player_data['guildId']
guild = comlink.get_guild(guild_id)
guild_name = guild['profile']['name']
Usage example with non-default settings for a swgoh-comlink service running on the local machine at TCP port 3500 and swgoh-stats service running on the local machine at TCP port 3550:
from swgoh_comlink import SwgohComlink
comlink = SwgohComlink(url='http://localhost:3500', stats_url='http://localhost:3550')
player_data = comlink.get_player(245866537)
player_roster = player_data['rosterUnit']
roster_with_stats = comlink.get_unit_stats(player_roster)
Usage example with MHAC enabled:
from swgoh_comlink import SwgohComlink
comlink = SwgohComlink(
url='http://localhost:3000',
access_key='public_key',
secret_key='this_string_should_be_secret'
)
player_data = comlink.get_player(allycode=245866537)
player_name = player_data['name']
Parameters
- url: the URL where the swgoh-comlink service is running. Defaults to
http://localhost:3000
- access_key: The "public" portion of the shared key used in HMAC request signing. Defaults to
None
which disables HMAC signing of requests. Can also be read from the ACCESS_KEY environment variable. - secret_key: The "private" portion of the key used in HMAC request signing. Defaults to
None
which disables HMAC signing of requests. Can also be read from the SECRET_KEY environment variable.
See the online wiki for more information.
Support
Issues can be reported in GitHub.
Join the discord server
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 swgoh_comlink-1.12.4.tar.gz
.
File metadata
- Download URL: swgoh_comlink-1.12.4.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d3ec0c2783829b34862a54b93275502ca9622794ea8bf6c1e9edd023777086 |
|
MD5 | 3d3f09e3515cc45715e15353253c31fd |
|
BLAKE2b-256 | e3d51b51be11874031f54e2de664178216bff0687644c4cf3ee0f3e5f104670b |
File details
Details for the file swgoh_comlink-1.12.4-py3-none-any.whl
.
File metadata
- Download URL: swgoh_comlink-1.12.4-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94fd57c1bdf64d7651d254209863bf49eb30586cd44f6c74e2a05ef451cd2822 |
|
MD5 | 7697e35a76e0737eaef9f1d538b27cd6 |
|
BLAKE2b-256 | 3bc034906d3d17f09166863e9a9a4a520568e6e8a92f0e685a6954af5cbc04b1 |