Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

gw2apiwrapper Build Status Coverage Status

gw2apiwrapper is a Python library designed to abstract away the overhead and complexity of interacting with the official Guild Wars 2 (GW2) API via Python.

The library aims to make it easy to write and read Python applications and tools with only a minimal knowledge of the GW2 API itself.

This is accomplished by abstracting away the standard JSON->dictionary mapping scheme that is so commonly used and replace it with an OOP-style (eg. item.name) notation.

Installation

Simply install with pip/pipenv and you’re good to go:

pip install gw2apiwrapper

Example

from gw2apiwrapper import AccountAPI, GlobalAPI

# Get an account based object. Requires API Key.
personal = AccountAPI("<APIKEY>")

# Get a 'Global' api object. (Non-authed)
workHorse = GlobalAPI()

# This is iterable, as not only does it fill the personal.bank
# attribute, it also returns that information allowing it to be
# used in loops..even though we don't here.
personal.getBank()

# Should be self documenting, but demonstrates that the previous
# getBank() call actually populated that object's 'bank' attribute.
bankIDs = [slot['id'] for slot in personal.bank if slot is not None]

# GlobalAPI's getItem can take different types, all documented.
itemObjects = workHorse.getItem(bankIDs)

# Get the names of all items in bank.
for item in itemObjects:
  print(item.name)

NOTES

This project is in semi-active development. The groundwork is laid, and most of the API is accounted for. If something you need is missing and you’d like it added feel free to open an issue (or a pull request!) on GitHub.

Metadata

Release files for gw2apiwrapper 2.7.5

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

Source distribution (sdist)

Source distribution for gw2apiwrapper 2.7.5
File Size Uploaded
gw2apiwrapper-2.7.5.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gw2apiwrapper 2.7.5
File Interpreter ABI Platform
gw2apiwrapper-2.7.5-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / gw2apiwrapper-2.7.5.tar.gz

Download URL gw2apiwrapper-2.7.5.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
38e2125dedcf4060bba1a1282fa16e1154ae3035982047d69ff3f9b23966316d
BLAKE2b-256 checksum
How to use checksums
c13dbaa0413b45d2576ee790c5f657d659fbfe3620282a1fd3a3a699b948d96b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release files / gw2apiwrapper-2.7.5-py3-none-any.whl

Download URL gw2apiwrapper-2.7.5-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23c836200c99964d40372bd5bfdf6930977d28b114faba13f48b0ad4f014fd23
BLAKE2b-256 checksum
How to use checksums
d97a50521072377b555a9b13415900c49f4e843a1565c9374f603659916db723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3
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