Skip to main content

Python client for the Kanka API

Project description

python-kanka

A modern Python client for the Kanka API, the collaborative worldbuilding and campaign management platform.

Originally inspired by/forked from Kathrin Weihe's python-kanka. Thank you to Kathrin for the foundation and inspiration.

Features

  • 12 Entity Types: Characters, Locations, Organisations, Families, Calendars, Events, Quests, Journals, Notes, Tags, Races, Creatures
  • Type Safety: Built with Pydantic v2 for data validation and type hints
  • Consistent API: Same CRUD interface across all entity types
  • Posts, Assets & Images: Full support for entity sub-resources and automatic image management
  • Search & Filtering: Search across types, filter by name/tags/privacy/dates
  • Rate Limit Handling: Automatic retry with exponential backoff
  • Pagination: Built-in pagination support with metadata

Installation

pip install python-kanka

Quick Start

from kanka import KankaClient

client = KankaClient(token="your-api-token", campaign_id=12345)

# Create a character
gandalf = client.characters.create(
    name="Gandalf the Grey",
    type="Wizard",
    title="Istari",
)

# List with filters
wizards = client.characters.list(type="Wizard", is_private=False)

# Search across all entity types
results = client.search("dragon")

# Update and delete
gandalf = client.characters.update(gandalf, title="The White")
client.characters.delete(gandalf)

Documentation

See the full documentation for guides, examples, and complete API reference.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_kanka-2.6.0.tar.gz (169.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_kanka-2.6.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file python_kanka-2.6.0.tar.gz.

File metadata

  • Download URL: python_kanka-2.6.0.tar.gz
  • Upload date:
  • Size: 169.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_kanka-2.6.0.tar.gz
Algorithm Hash digest
SHA256 564f80377e7ecee45e880b0c720411e40dda73c713ee41d261ca94c37d9b5507
MD5 29e87242e9a64342ff4e341109827bc7
BLAKE2b-256 9779e2e3a4d1826931f69bdaf71e4a7f9c3e0a7a3af9e68954748bb11c62f50d

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_kanka-2.6.0.tar.gz:

Publisher: publish.yml on ervwalter/python-kanka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_kanka-2.6.0-py3-none-any.whl.

File metadata

  • Download URL: python_kanka-2.6.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for python_kanka-2.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d92cd0b0cf2a044440280d7d61444dbc36a8df23596cbda1fdb20a1674b81c6
MD5 a2afec83aea71d553f7aea99d2cef584
BLAKE2b-256 79f419609c5e467f062d5083b8e8a6fb6d8e2088fc7d4d9ba93d3e3c56baf05c

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_kanka-2.6.0-py3-none-any.whl:

Publisher: publish.yml on ervwalter/python-kanka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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