Skip to main content

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

Requires Python 3.12 or newer. CI tests Python 3.12–3.15.

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.

Metadata

Release files for python-kanka 2.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-kanka 2.6.4
File Size Uploaded Provenance Actions
python_kanka-2.6.4.tar.gz 219.0 kB With provenance Details for python_kanka-2.6.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-kanka 2.6.4
File Interpreter ABI Platform Actions
python_kanka-2.6.4-py3-none-any.whl Python 3 none any Details for python_kanka-2.6.4-py3-none-any.whl

Total release size: 246.0 kB

Release files / python_kanka-2.6.4.tar.gz

Download URL python_kanka-2.6.4.tar.gz
Size 219.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a4425db3bc6624d66659bd44c132660b21c07fc916f4a4e170c35cef8ceebc72
BLAKE2b-256 checksum
How to use checksums
bbab051486f0a6dc7ac511768b6b8e3aeaa3a2cf52f49c2be0b991dcf2d1fbf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / python_kanka-2.6.4-py3-none-any.whl

Download URL python_kanka-2.6.4-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2cdd80682749171251ff933e331cada1f8d59309c768855996f33c22762d7e4
BLAKE2b-256 checksum
How to use checksums
a5d77bd37456e4775ee1d0e2cc061c90e47bd91e3fa980ef3c10e909e2142ce3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for python-kanka 2.6.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for python_kanka-2.6.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page