Skip to main content

A small wrapper library around the World Anvil Aragorn API: https://www.worldanvil.com/api/aragorn/documentation.

Project description

World Anvil API Python Client

The World Anvil API provides endpoints to interact with the World Anvil data base.

API Documentation

Installation

The package is published on PYPI and can be installed with pip.

pip --install pywaclient

Usage

This library can be used either by accessing the json data returned by the api client or use the class wrapper with properties and access points.

Instantiate the client:

from pywaclient.api import BoromirApiClient

client = BoromirApiClient(
    '<YourScriptName>',
    '<link-to-your-website-or-bot-repository>', '<version>', os.environ['WA_APPLICATION_KEY'],
    os.environ['WA_AUTH_TOKEN']
)

Load an article:

article_metadata = client.article.get('<article-id>')

Create article model:

from pywaclient.models.article import Article

article = Article(client, client.article.get('<article-id>'))

The model is a wrapper with some convience properties for the JSON file. Not all fields can be extracted like that, but any fields without an element can be extracted with the property name as a dictionary accessor:

identifier = article.id
author: User = article.author
world: World = article.world
passcode = article['passcode']

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

pywaclient-1.1.8.tar.gz (24.8 kB view hashes)

Uploaded Source

Built Distribution

pywaclient-1.1.8-py3-none-any.whl (55.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page