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.
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
Built Distribution
Hashes for pywaclient-1.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5c58dbeeec4e377df9fffb0efa1338fbd3f7b23de408b2a193ccf6c35ac376c |
|
MD5 | bf82045933440ecd65a6640133ff41ea |
|
BLAKE2b-256 | c10784840f2ed98e0674a550dd12687bcdf9cb08b3040c93fd7c4ffa5eb02c31 |