bgg4py
bgg4py is a Boardgamegeek API wrapper.
Requirements
Python 3.7+
Installation
$ pip install bgg4py
Example
CLI
- Check Command Options
$ python -m bgg4py.cli
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
family-items
forum-lists
forums
geeklist
hot-items
search
thing
threads
user-collection
users
- Check Subcommand Options
$ python -m bgg4py.cli users
Usage: cli.py users [OPTIONS]
Try 'cli.py users --help' for help.
Error: Missing option '--name'.
- Run!
$ python -m bgg4py.cli users --name hiroaqii
https://www.boardgamegeek.com/xmlapi2/user?name=hiroaqii&guilds=1&hot=1&top=1
{
"id": 1422482,
"name": "hiroaqii",
"firstname": "hiro",
"lastname": "aqii",
"avatarlink": "N/A",
"yearregistered": 2016,
"lastlogin": "2020-06-06",
"stateorprovince": "",
"country": "",
"webaddress": "",
"xboxaccount": "",
"wiiaccount": "",
"psnaccount": "",
"battlenetaccount": "",
"steamaccount": "",
"traderating": 0,
"marketrating": 1
}
Script
from bgg4py import api
ret = api.user_collection('hiroaqii')
# returns a dictionary representing the model as JSON Schem
print(ret.schema())
# output example
print(ret.item_list[0].image)
print(retret.item_list[0])
print(ret.item_list[0].status)
print(ret.item_list[0].status.lastmodified)
print("\n".join([item.name for item in ret.item_list]))
# output json
ret_json = json.dumps(ret.dict(), indent=4, ensure_ascii=False)
pritn(ret_json)
Metadata
Release files for bgg4py 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bgg4py-0.0.2.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bgg4py-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / bgg4py-0.0.2.tar.gz
| Download URL | bgg4py-0.0.2.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
345a6d36f3442fa285bc751a0ec01a647a06fd39a69945926c3a6632e2a54bc6
|
|
BLAKE2b-256 checksum How to use checksums |
1ddf50df1c33438b1a07e1d63c7e9d752cf031fe8a2067a0f15cb2f855f3a531
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.8 CPython/3.7.7 Linux/4.15.0-99-generic
|
Release files / bgg4py-0.0.2-py3-none-any.whl
| Download URL | bgg4py-0.0.2-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed702a7a3c8f99ebe14065d241ac3d63191749d98ae16b727319e48b5b7c9bf1
|
|
BLAKE2b-256 checksum How to use checksums |
92901d3d98af2551038b1ad40a84c84b05f5d8f9b96307f3a870d85458576b7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.8 CPython/3.7.7 Linux/4.15.0-99-generic
|