Coder Social home page Coder Social logo

pygw2's Introduction

Pygw2

Tests and Coverage codecov

Python wrapper for Guild Wars 2 api.

How to use

Basic principle is that every endpoint needing IDs to fetch, allow 0 to n positional arguments (IDs). But due to API limitation it will be from 0 to 200 as it is the maximum number objects the API will return.

This wrapper is structured as follows:

api.<CATEGORY>.<ENDPOINT>(<ID(s)>)

or

api.<CATEGORY>.<SUBCATEGORY>.<ENDPOINT>(<ID(s)>)

Categories and endpoints somewhat match the Guild Wars 2 Wiki documentation of the API.

For example: You can access the items-endpoint from items-category:

api.items.get()

or you can access skins-endpoint from the items-category as well:

api.items.skins()

The whole structure will be documented later.

Sub-endpoints

Subenpoints are handled by classes, by giving them the ID like so:

api.account.character(character_id).core()

Example

from pygw2.api import Api

api = Api(api_key="YOUR API KEY HERE (if you want to use it)')

# Get one achievement by ID
achievement = api.achievements.get(1)

# Get all achievement IDs
all_achievement_ids = api.achievements.get()

# Get multiple items
some_items = api.items.get(6542, 6, 24)

From the setup -function, the API key will be forwarded for 'deeper' API classes and functions.

Missing endpoint

If you find that there is one or more endpoints not covered by this API wrapper and the endpoints would provide some useful information, please create an Issue and I will take care of it or if you want to, you could do it yourself, but be sure to follow the same structure.

API coverage

This library SHOULD cover the non-deprecated part of the Version 2.

pygw2's People

Contributors

natsku123 avatar

Stargazers

Jasper Hjorth avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.