A small wrapper library around the World Anvil Aragorn API: https://www.worldanvil.com/api/aragorn/documentation.
Project description
World Anvil API Python Client [WIP]
This wrapper client is a work in progress. It is not feature complete and the API is subject to change. It works with the Boromir API released by World Anvil on 26th of August 2023. I will attempt to keep this client up to date with the latest version of the API. If you find any issues feel free to open an issue and I will try to fix it.
The World Anvil API provides endpoints to interact with the World Anvil database.
Boromir API Documentation is available at: Boromir API Documentation
Boromir API Swagger Documentation
The Aragorn API is deprecated and will be removed in the future. It is still available at:
The latest version which works with Aragorn is 0.12.1
. After that the client only works with Boromir. I will not
maintain the Aragorn version of the client.
Installation
The package is published on PYPI and can be installed with pip.
pip --install pywaclient
Usage
This is a simple example on how to use the endpoints.
import os
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']
)
# get your own user id. It is not possible to discover the user ids of other users via the API.
authenticated_user = client.user.identity()
# get the references to all the worlds on your account.
worlds = [world for world in client.user.worlds(authenticated_user['id'])]
# get the references to all the category on the first world.
categories = [category for category in client.world.categories(worlds[0]['id'])]
# gets a list of all the articles without a category in the first world
articles = [article for article in client.category.articles(worlds[0]['id'], '-1')]
# gets the full content of the first article
article = client.article.get(articles[0]['id'], 2)
# gets the full content of the first category. Categories and most other resources do not have a granularity of 2.
category = client.category.get(categories[0]['id'], 1)
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.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75fa30e9d4e2d8821e2e0e656782a8524442cb1d77f25732d98cd3b122f998af |
|
MD5 | 11bba04f34f6bc134157a4c3a18d00b5 |
|
BLAKE2b-256 | 42bb914fa12f5818d3facdbc58684405022f7ee463b5361dc93d576511a01fe7 |