python-kanka 2.2.0__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.bumpversion.cfg +5 -1
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.github/renovate.json +2 -1
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.github/workflows/ci.yml +12 -18
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.github/workflows/publish.yml +20 -24
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.gitignore +1 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/.pre-commit-config.yaml +4 -4
- {python_kanka-2.2.0 → python_kanka-2.4.0}/CLAUDE.md +85 -15
- {python_kanka-2.2.0 → python_kanka-2.4.0}/Makefile +24 -16
- python_kanka-2.4.0/PKG-INFO +89 -0
- python_kanka-2.4.0/README.md +61 -0
- python_kanka-2.4.0/docs/README.md +55 -0
- python_kanka-2.4.0/docs/api-reference.md +609 -0
- python_kanka-2.4.0/docs/assets-and-images.md +266 -0
- python_kanka-2.4.0/docs/core-concepts.md +98 -0
- python_kanka-2.4.0/docs/debug-mode.md +67 -0
- python_kanka-2.4.0/docs/entities.md +243 -0
- python_kanka-2.4.0/docs/entity-types-reference.md +363 -0
- python_kanka-2.4.0/docs/error-handling.md +166 -0
- python_kanka-2.4.0/docs/gallery.md +87 -0
- python_kanka-2.4.0/docs/getting-started.md +106 -0
- python_kanka-2.4.0/docs/known-limitations.md +57 -0
- python_kanka-2.4.0/docs/pagination.md +124 -0
- python_kanka-2.4.0/docs/posts.md +212 -0
- python_kanka-2.4.0/docs/rate-limiting.md +73 -0
- python_kanka-2.4.0/docs/search-and-filtering.md +166 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/pyproject.toml +61 -5
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/__init__.py +8 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/_version.py +1 -1
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/client.py +169 -32
- python_kanka-2.4.0/src/kanka/managers.py +950 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/models/__init__.py +12 -1
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/models/base.py +9 -10
- python_kanka-2.4.0/src/kanka/models/common.py +245 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/models/entities.py +50 -52
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/types.py +1 -2
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/base.py +62 -4
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/run_integration_tests.py +4 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_calendars_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_characters_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_creatures_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_entities_api_integration.py +1 -19
- python_kanka-2.4.0/tests/integration/test_entity_assets_integration.py +243 -0
- python_kanka-2.4.0/tests/integration/test_entity_images_integration.py +292 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_entity_tags_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_events_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_families_integration.py +1 -19
- python_kanka-2.4.0/tests/integration/test_gallery_integration.py +148 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_journals_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_locations_integration.py +1 -18
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_mentions_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_notes_integration.py +1 -18
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_organisations_integration.py +1 -18
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_posts_integration.py +1 -18
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_quests_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_races_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_search_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_tags_integration.py +1 -19
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_client.py +159 -3
- python_kanka-2.4.0/tests/test_managers.py +1116 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_models.py +120 -1
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/utils.py +68 -4
- python_kanka-2.4.0/uv.lock +1166 -0
- python_kanka-2.2.0/API_REFERENCE.md +0 -701
- python_kanka-2.2.0/PKG-INFO +0 -377
- python_kanka-2.2.0/README.md +0 -322
- python_kanka-2.2.0/dev-requirements.txt +0 -20
- python_kanka-2.2.0/examples/crud_operations.py +0 -236
- python_kanka-2.2.0/examples/error_handling.py +0 -246
- python_kanka-2.2.0/examples/filtering.py +0 -186
- python_kanka-2.2.0/examples/migration.py +0 -419
- python_kanka-2.2.0/examples/posts.py +0 -167
- python_kanka-2.2.0/examples/quickstart.py +0 -135
- python_kanka-2.2.0/requirements.txt +0 -3
- python_kanka-2.2.0/setup.cfg +0 -4
- python_kanka-2.2.0/setup.py +0 -72
- python_kanka-2.2.0/src/kanka/managers.py +0 -540
- python_kanka-2.2.0/src/kanka/models/common.py +0 -145
- python_kanka-2.2.0/src/python_kanka.egg-info/PKG-INFO +0 -377
- python_kanka-2.2.0/src/python_kanka.egg-info/SOURCES.txt +0 -78
- python_kanka-2.2.0/src/python_kanka.egg-info/dependency_links.txt +0 -1
- python_kanka-2.2.0/src/python_kanka.egg-info/not-zip-safe +0 -1
- python_kanka-2.2.0/src/python_kanka.egg-info/requires.txt +0 -13
- python_kanka-2.2.0/src/python_kanka.egg-info/top_level.txt +0 -1
- python_kanka-2.2.0/tests/test_managers.py +0 -459
- {python_kanka-2.2.0 → python_kanka-2.4.0}/CHANGELOG.md +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/LICENSE +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/MANIFEST.in +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/PUBLISHING.md +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/pytest.ini +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/exceptions.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/src/kanka/py.typed +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/__init__.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/README.md +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/__init__.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/full_test_output_fixed.txt +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/setup_test_env.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_calendars_simple.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_rate_limiting.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/integration/test_tag_colour.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/mypy.ini +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_client_advanced.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_entity_models.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_exceptions.py +0 -0
- {python_kanka-2.2.0 → python_kanka-2.4.0}/tests/test_models_advanced.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[bumpversion]
|
|
2
|
-
current_version = 2.
|
|
2
|
+
current_version = 2.4.0
|
|
3
3
|
commit = True
|
|
4
4
|
tag = True
|
|
5
5
|
tag_name = v{new_version}
|
|
@@ -8,3 +8,7 @@ message = Bump version: {current_version} → {new_version}
|
|
|
8
8
|
[bumpversion:file:src/kanka/_version.py]
|
|
9
9
|
search = __version__ = "{current_version}"
|
|
10
10
|
replace = __version__ = "{new_version}"
|
|
11
|
+
|
|
12
|
+
[bumpversion:file:pyproject.toml]
|
|
13
|
+
search = version = "{current_version}"
|
|
14
|
+
replace = version = "{new_version}"
|
|
@@ -12,42 +12,36 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
fail-fast: false
|
|
14
14
|
matrix:
|
|
15
|
-
python-version: ["3.
|
|
15
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
19
|
|
|
20
|
-
- name:
|
|
21
|
-
uses:
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
22
|
with:
|
|
23
|
-
|
|
23
|
+
enable-cache: true
|
|
24
|
+
cache-dependency-glob: "uv.lock"
|
|
24
25
|
|
|
25
|
-
- name:
|
|
26
|
-
|
|
27
|
-
with:
|
|
28
|
-
path: ~/.cache/pip
|
|
29
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/dev-requirements.txt') }}
|
|
30
|
-
restore-keys: |
|
|
31
|
-
${{ runner.os }}-pip-
|
|
26
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
+
run: uv python install ${{ matrix.python-version }}
|
|
32
28
|
|
|
33
29
|
- name: Install dependencies
|
|
34
30
|
run: |
|
|
35
|
-
|
|
36
|
-
pip install -
|
|
37
|
-
pip install -r dev-requirements.txt
|
|
38
|
-
pip install -e .
|
|
31
|
+
uv sync --all-groups
|
|
32
|
+
uv pip install -e .
|
|
39
33
|
|
|
40
34
|
- name: Run all quality checks
|
|
41
35
|
run: |
|
|
42
36
|
make check
|
|
43
37
|
|
|
44
38
|
- name: Generate coverage report
|
|
45
|
-
if: matrix.python-version == '3.
|
|
39
|
+
if: matrix.python-version == '3.14'
|
|
46
40
|
run: |
|
|
47
41
|
make coverage
|
|
48
42
|
|
|
49
43
|
- name: Upload coverage reports to Codecov
|
|
50
|
-
if: matrix.python-version == '3.
|
|
44
|
+
if: matrix.python-version == '3.14'
|
|
51
45
|
uses: codecov/codecov-action@v5
|
|
52
46
|
env:
|
|
53
47
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -16,22 +16,24 @@ jobs:
|
|
|
16
16
|
runs-on: ubuntu-latest
|
|
17
17
|
strategy:
|
|
18
18
|
matrix:
|
|
19
|
-
python-version: ["3.
|
|
19
|
+
python-version: ["3.12", "3.13", "3.14"]
|
|
20
20
|
|
|
21
21
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
23
|
|
|
24
|
-
- name:
|
|
25
|
-
uses:
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v7
|
|
26
26
|
with:
|
|
27
|
-
|
|
27
|
+
enable-cache: true
|
|
28
|
+
cache-dependency-glob: "uv.lock"
|
|
29
|
+
|
|
30
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
+
run: uv python install ${{ matrix.python-version }}
|
|
28
32
|
|
|
29
33
|
- name: Install dependencies
|
|
30
34
|
run: |
|
|
31
|
-
|
|
32
|
-
pip install -
|
|
33
|
-
pip install -r dev-requirements.txt
|
|
34
|
-
pip install -e .
|
|
35
|
+
uv sync --all-groups
|
|
36
|
+
uv pip install -e .
|
|
35
37
|
|
|
36
38
|
- name: Run all quality checks
|
|
37
39
|
run: |
|
|
@@ -41,26 +43,20 @@ jobs:
|
|
|
41
43
|
needs: test
|
|
42
44
|
runs-on: ubuntu-latest
|
|
43
45
|
steps:
|
|
44
|
-
- uses: actions/checkout@
|
|
46
|
+
- uses: actions/checkout@v6
|
|
45
47
|
|
|
46
|
-
- name:
|
|
47
|
-
uses:
|
|
48
|
-
with:
|
|
49
|
-
python-version: '3.13'
|
|
48
|
+
- name: Install uv
|
|
49
|
+
uses: astral-sh/setup-uv@v7
|
|
50
50
|
|
|
51
|
-
- name:
|
|
52
|
-
run:
|
|
53
|
-
python -m pip install --upgrade pip
|
|
54
|
-
pip install build twine
|
|
51
|
+
- name: Set up Python
|
|
52
|
+
run: uv python install 3.14
|
|
55
53
|
|
|
56
54
|
- name: Build package
|
|
57
|
-
run:
|
|
58
|
-
|
|
59
|
-
- name: Check package
|
|
60
|
-
run: twine check dist/*
|
|
55
|
+
run: |
|
|
56
|
+
uv build
|
|
61
57
|
|
|
62
58
|
- name: Upload artifacts
|
|
63
|
-
uses: actions/upload-artifact@
|
|
59
|
+
uses: actions/upload-artifact@v5
|
|
64
60
|
with:
|
|
65
61
|
name: dist
|
|
66
62
|
path: dist/
|
|
@@ -75,7 +71,7 @@ jobs:
|
|
|
75
71
|
|
|
76
72
|
steps:
|
|
77
73
|
- name: Download artifacts
|
|
78
|
-
uses: actions/download-artifact@
|
|
74
|
+
uses: actions/download-artifact@v6
|
|
79
75
|
with:
|
|
80
76
|
name: dist
|
|
81
77
|
path: dist/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
3
|
repos:
|
|
4
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
5
|
-
rev:
|
|
5
|
+
rev: v6.0.0
|
|
6
6
|
hooks:
|
|
7
7
|
- id: trailing-whitespace
|
|
8
8
|
- id: end-of-file-fixer
|
|
@@ -15,19 +15,19 @@ repos:
|
|
|
15
15
|
- id: mixed-line-ending
|
|
16
16
|
|
|
17
17
|
- repo: https://github.com/psf/black
|
|
18
|
-
rev:
|
|
18
|
+
rev: 26.1.0
|
|
19
19
|
hooks:
|
|
20
20
|
- id: black
|
|
21
21
|
language_version: python3
|
|
22
22
|
|
|
23
23
|
- repo: https://github.com/pycqa/isort
|
|
24
|
-
rev:
|
|
24
|
+
rev: 8.0.0
|
|
25
25
|
hooks:
|
|
26
26
|
- id: isort
|
|
27
27
|
args: ["--profile", "black"]
|
|
28
28
|
|
|
29
29
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
30
|
-
rev: v0.
|
|
30
|
+
rev: v0.15.2
|
|
31
31
|
hooks:
|
|
32
32
|
- id: ruff
|
|
33
33
|
args: ["--fix"]
|
|
@@ -4,10 +4,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
4
4
|
|
|
5
5
|
## Key Development Commands
|
|
6
6
|
|
|
7
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management. All commands are wrapped in the Makefile for convenience:
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
|
-
# Install development environment
|
|
10
|
+
# Install development environment (uses uv sync)
|
|
9
11
|
make install
|
|
10
12
|
|
|
13
|
+
# Sync dependencies without updating lock file
|
|
14
|
+
make sync
|
|
15
|
+
|
|
11
16
|
# Run unit tests only (no integration tests)
|
|
12
17
|
make test
|
|
13
18
|
|
|
@@ -31,12 +36,67 @@ make typecheck
|
|
|
31
36
|
make check
|
|
32
37
|
|
|
33
38
|
# Build the package
|
|
34
|
-
|
|
39
|
+
make build
|
|
35
40
|
|
|
36
41
|
# Generate coverage report
|
|
37
42
|
make coverage
|
|
38
43
|
```
|
|
39
44
|
|
|
45
|
+
### Direct uv commands
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Install dependencies
|
|
49
|
+
uv sync --all-groups
|
|
50
|
+
|
|
51
|
+
# Run a command in the environment
|
|
52
|
+
uv run pytest
|
|
53
|
+
|
|
54
|
+
# Add a new dependency
|
|
55
|
+
uv add package-name
|
|
56
|
+
|
|
57
|
+
# Add a dev dependency
|
|
58
|
+
uv add --group dev package-name
|
|
59
|
+
|
|
60
|
+
# Update dependencies
|
|
61
|
+
uv lock --upgrade
|
|
62
|
+
|
|
63
|
+
# Build the package
|
|
64
|
+
uv build
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Git Commit Message Format
|
|
68
|
+
|
|
69
|
+
This project uses conventional commits format:
|
|
70
|
+
```
|
|
71
|
+
<type>(<scope>): <subject>
|
|
72
|
+
|
|
73
|
+
<body>
|
|
74
|
+
|
|
75
|
+
<footer>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Types:**
|
|
79
|
+
- `feat`: New feature
|
|
80
|
+
- `fix`: Bug fix
|
|
81
|
+
- `docs`: Documentation only changes
|
|
82
|
+
- `style`: Code style changes (formatting, missing semicolons, etc)
|
|
83
|
+
- `refactor`: Code change that neither fixes a bug nor adds a feature
|
|
84
|
+
- `test`: Adding missing tests or correcting existing tests
|
|
85
|
+
- `chore`: Changes to build process, dependencies, or auxiliary tools
|
|
86
|
+
|
|
87
|
+
**Examples:**
|
|
88
|
+
- `feat: add pagination properties to EntityManager`
|
|
89
|
+
- `fix: replace is_private with visibility_id parameter for posts`
|
|
90
|
+
- `chore(deps): update dependency ruff to v0.11.13`
|
|
91
|
+
- `refactor: reorganize package structure for PyPI publishing`
|
|
92
|
+
|
|
93
|
+
**Note:** When Claude generates commits, they should include the attribution at the end of the commit body:
|
|
94
|
+
```
|
|
95
|
+
🤖 Generated with [Claude Code](https://claude.ai/code)
|
|
96
|
+
|
|
97
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
98
|
+
```
|
|
99
|
+
|
|
40
100
|
## Architecture Overview
|
|
41
101
|
|
|
42
102
|
The SDK follows a **Client → Manager → Model** pattern that requires understanding across multiple files:
|
|
@@ -118,25 +178,35 @@ When testing against the real API:
|
|
|
118
178
|
|
|
119
179
|
**CRITICAL**: When making ANY changes to the API, models, exceptions, or client behavior:
|
|
120
180
|
|
|
121
|
-
1. **Always update
|
|
122
|
-
- New/changed model fields and their types
|
|
123
|
-
- New/changed method signatures
|
|
124
|
-
- New/changed exception types
|
|
125
|
-
- New/changed client constructor parameters
|
|
126
|
-
-
|
|
181
|
+
1. **Always update the relevant files in `docs/`** to reflect:
|
|
182
|
+
- New/changed model fields and their types → `docs/entity-types-reference.md` and `docs/api-reference.md`
|
|
183
|
+
- New/changed method signatures → `docs/api-reference.md` and the relevant guide page
|
|
184
|
+
- New/changed exception types → `docs/error-handling.md` and `docs/api-reference.md`
|
|
185
|
+
- New/changed client constructor parameters → `docs/api-reference.md`
|
|
186
|
+
- New features or usage patterns → the relevant guide page in `docs/`
|
|
127
187
|
|
|
128
|
-
2. **Always update README.md
|
|
188
|
+
2. **Always update `README.md`** when changes affect:
|
|
129
189
|
- Installation instructions
|
|
130
190
|
- Basic usage examples
|
|
131
191
|
- Key features or capabilities
|
|
132
|
-
- Version compatibility
|
|
133
192
|
|
|
134
193
|
3. **Documentation must be 100% accurate** - inconsistencies between docs and implementation cause significant user confusion
|
|
135
194
|
|
|
136
195
|
4. **Remove deprecated features** - don't just mark as deprecated, actively remove outdated documentation when legacy code is removed
|
|
137
196
|
|
|
138
|
-
**
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
197
|
+
**Documentation structure:**
|
|
198
|
+
- `docs/README.md` — Index page linking to all docs
|
|
199
|
+
- `docs/getting-started.md` — Installation and quick start
|
|
200
|
+
- `docs/core-concepts.md` — Architecture and key concepts
|
|
201
|
+
- `docs/entities.md` — CRUD operations guide
|
|
202
|
+
- `docs/entity-types-reference.md` — All entity type fields
|
|
203
|
+
- `docs/posts.md` — Posts management
|
|
204
|
+
- `docs/assets-and-images.md` — Assets, images, automatic image management
|
|
205
|
+
- `docs/gallery.md` — Campaign gallery
|
|
206
|
+
- `docs/search-and-filtering.md` — Search and filtering
|
|
207
|
+
- `docs/pagination.md` — Pagination
|
|
208
|
+
- `docs/error-handling.md` — Exception types and patterns
|
|
209
|
+
- `docs/rate-limiting.md` — Rate limit configuration
|
|
210
|
+
- `docs/api-reference.md` — Complete API reference
|
|
211
|
+
- `docs/debug-mode.md` — Debug mode
|
|
212
|
+
- `docs/known-limitations.md` — API quirks and gotchas
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
.PHONY: install test lint format typecheck check clean coverage help
|
|
1
|
+
.PHONY: install test lint format typecheck check clean coverage help sync build
|
|
2
2
|
|
|
3
3
|
# Default target
|
|
4
4
|
help:
|
|
5
5
|
@echo "Available commands:"
|
|
6
|
-
@echo " make install - Install development dependencies"
|
|
6
|
+
@echo " make install - Install development dependencies with uv"
|
|
7
|
+
@echo " make sync - Sync dependencies with uv.lock"
|
|
7
8
|
@echo " make test - Run all tests"
|
|
8
9
|
@echo " make lint - Run code linting"
|
|
9
10
|
@echo " make typecheck - Run type checking with mypy"
|
|
@@ -11,36 +12,39 @@ help:
|
|
|
11
12
|
@echo " make check - Run all checks (lint + typecheck + test)"
|
|
12
13
|
@echo " make clean - Clean up temporary files"
|
|
13
14
|
@echo " make coverage - Run tests with coverage report"
|
|
15
|
+
@echo " make build - Build the package"
|
|
14
16
|
|
|
15
|
-
# Install development dependencies
|
|
17
|
+
# Install development dependencies and sync with lock file
|
|
16
18
|
install:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
uv sync --all-groups
|
|
20
|
+
|
|
21
|
+
# Sync dependencies without updating lock file
|
|
22
|
+
sync:
|
|
23
|
+
uv sync --all-groups
|
|
20
24
|
|
|
21
25
|
# Run all tests
|
|
22
26
|
test:
|
|
23
|
-
pytest tests/ -v
|
|
27
|
+
uv run pytest tests/ -v
|
|
24
28
|
|
|
25
29
|
# Run linting
|
|
26
30
|
lint:
|
|
27
|
-
ruff check .
|
|
28
|
-
black --check .
|
|
29
|
-
isort --check-only .
|
|
31
|
+
uv run ruff check .
|
|
32
|
+
uv run black --check .
|
|
33
|
+
uv run isort --check-only .
|
|
30
34
|
|
|
31
35
|
# Run type checking
|
|
32
36
|
typecheck:
|
|
33
|
-
mypy src/kanka tests
|
|
37
|
+
uv run mypy src/kanka tests --ignore-missing-imports
|
|
34
38
|
|
|
35
39
|
# Format code
|
|
36
40
|
format:
|
|
37
|
-
black .
|
|
38
|
-
isort .
|
|
39
|
-
ruff check --fix .
|
|
41
|
+
uv run black .
|
|
42
|
+
uv run isort .
|
|
43
|
+
uv run ruff check --fix .
|
|
40
44
|
|
|
41
45
|
# Run pre-commit hooks on all files
|
|
42
46
|
pre-commit:
|
|
43
|
-
pre-commit run --all-files
|
|
47
|
+
uv run pre-commit run --all-files
|
|
44
48
|
|
|
45
49
|
# Run all checks
|
|
46
50
|
check: lint typecheck test
|
|
@@ -62,4 +66,8 @@ clean:
|
|
|
62
66
|
|
|
63
67
|
# Run tests with coverage
|
|
64
68
|
coverage:
|
|
65
|
-
pytest tests/ -v --cov=src/kanka --cov-report=html --cov-report=term
|
|
69
|
+
uv run pytest tests/ -v --cov=src/kanka --cov-report=html --cov-report=term
|
|
70
|
+
|
|
71
|
+
# Build the package
|
|
72
|
+
build:
|
|
73
|
+
uv build
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-kanka
|
|
3
|
+
Version: 2.4.0
|
|
4
|
+
Summary: Python client for the Kanka API
|
|
5
|
+
Project-URL: Homepage, https://github.com/ervwalter/python-kanka
|
|
6
|
+
Project-URL: Documentation, https://github.com/ervwalter/python-kanka#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/ervwalter/python-kanka
|
|
8
|
+
Project-URL: Issues, https://github.com/ervwalter/python-kanka/issues
|
|
9
|
+
Author-email: Erv Walter <erv@ewal.net>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: api,campaign,dnd,kanka,pathfinder,rpg,tabletop,ttrpg,worldbuilding
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Games/Entertainment :: Role-Playing
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.12
|
|
24
|
+
Requires-Dist: pydantic==2.12.5
|
|
25
|
+
Requires-Dist: requests-toolbelt==1.0.0
|
|
26
|
+
Requires-Dist: requests==2.32.5
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# python-kanka
|
|
30
|
+
|
|
31
|
+
A modern Python client for the [Kanka API](https://app.kanka.io/api-docs/1.0), the collaborative worldbuilding and campaign management platform.
|
|
32
|
+
|
|
33
|
+
*Originally inspired by/forked from [Kathrin Weihe's python-kanka](https://github.com/rbtnx/python-kanka). Thank you to Kathrin for the foundation and inspiration.*
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- **12 Entity Types**: Characters, Locations, Organisations, Families, Calendars, Events, Quests, Journals, Notes, Tags, Races, Creatures
|
|
38
|
+
- **Type Safety**: Built with Pydantic v2 for data validation and type hints
|
|
39
|
+
- **Consistent API**: Same CRUD interface across all entity types
|
|
40
|
+
- **Posts, Assets & Images**: Full support for entity sub-resources and automatic image management
|
|
41
|
+
- **Search & Filtering**: Search across types, filter by name/tags/privacy/dates
|
|
42
|
+
- **Rate Limit Handling**: Automatic retry with exponential backoff
|
|
43
|
+
- **Pagination**: Built-in pagination support with metadata
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install python-kanka
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from kanka import KankaClient
|
|
55
|
+
|
|
56
|
+
client = KankaClient(token="your-api-token", campaign_id=12345)
|
|
57
|
+
|
|
58
|
+
# Create a character
|
|
59
|
+
gandalf = client.characters.create(
|
|
60
|
+
name="Gandalf the Grey",
|
|
61
|
+
type="Wizard",
|
|
62
|
+
title="Istari",
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# List with filters
|
|
66
|
+
wizards = client.characters.list(type="Wizard", is_private=False)
|
|
67
|
+
|
|
68
|
+
# Search across all entity types
|
|
69
|
+
results = client.search("dragon")
|
|
70
|
+
|
|
71
|
+
# Update and delete
|
|
72
|
+
gandalf = client.characters.update(gandalf, title="The White")
|
|
73
|
+
client.characters.delete(gandalf)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
See the **[full documentation](docs/)** for guides, examples, and complete API reference.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
83
|
+
|
|
84
|
+
## Links
|
|
85
|
+
|
|
86
|
+
- [Kanka.io](https://kanka.io) - The Kanka platform
|
|
87
|
+
- [Kanka API Documentation](https://app.kanka.io/api-docs/1.0) - Official API docs
|
|
88
|
+
- [GitHub Repository](https://github.com/ervwalter/python-kanka) - Source code
|
|
89
|
+
- [Issue Tracker](https://github.com/ervwalter/python-kanka/issues) - Report bugs or request features
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# python-kanka
|
|
2
|
+
|
|
3
|
+
A modern Python client for the [Kanka API](https://app.kanka.io/api-docs/1.0), the collaborative worldbuilding and campaign management platform.
|
|
4
|
+
|
|
5
|
+
*Originally inspired by/forked from [Kathrin Weihe's python-kanka](https://github.com/rbtnx/python-kanka). Thank you to Kathrin for the foundation and inspiration.*
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **12 Entity Types**: Characters, Locations, Organisations, Families, Calendars, Events, Quests, Journals, Notes, Tags, Races, Creatures
|
|
10
|
+
- **Type Safety**: Built with Pydantic v2 for data validation and type hints
|
|
11
|
+
- **Consistent API**: Same CRUD interface across all entity types
|
|
12
|
+
- **Posts, Assets & Images**: Full support for entity sub-resources and automatic image management
|
|
13
|
+
- **Search & Filtering**: Search across types, filter by name/tags/privacy/dates
|
|
14
|
+
- **Rate Limit Handling**: Automatic retry with exponential backoff
|
|
15
|
+
- **Pagination**: Built-in pagination support with metadata
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install python-kanka
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from kanka import KankaClient
|
|
27
|
+
|
|
28
|
+
client = KankaClient(token="your-api-token", campaign_id=12345)
|
|
29
|
+
|
|
30
|
+
# Create a character
|
|
31
|
+
gandalf = client.characters.create(
|
|
32
|
+
name="Gandalf the Grey",
|
|
33
|
+
type="Wizard",
|
|
34
|
+
title="Istari",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# List with filters
|
|
38
|
+
wizards = client.characters.list(type="Wizard", is_private=False)
|
|
39
|
+
|
|
40
|
+
# Search across all entity types
|
|
41
|
+
results = client.search("dragon")
|
|
42
|
+
|
|
43
|
+
# Update and delete
|
|
44
|
+
gandalf = client.characters.update(gandalf, title="The White")
|
|
45
|
+
client.characters.delete(gandalf)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Documentation
|
|
49
|
+
|
|
50
|
+
See the **[full documentation](docs/)** for guides, examples, and complete API reference.
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
55
|
+
|
|
56
|
+
## Links
|
|
57
|
+
|
|
58
|
+
- [Kanka.io](https://kanka.io) - The Kanka platform
|
|
59
|
+
- [Kanka API Documentation](https://app.kanka.io/api-docs/1.0) - Official API docs
|
|
60
|
+
- [GitHub Repository](https://github.com/ervwalter/python-kanka) - Source code
|
|
61
|
+
- [Issue Tracker](https://github.com/ervwalter/python-kanka/issues) - Report bugs or request features
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# python-kanka Documentation
|
|
2
|
+
|
|
3
|
+
A modern Python client for the [Kanka API](https://app.kanka.io/api-docs/1.0), the collaborative worldbuilding and campaign management platform.
|
|
4
|
+
|
|
5
|
+
## Guides
|
|
6
|
+
|
|
7
|
+
| Page | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| [Getting Started](getting-started.md) | Installation, setup, and your first API call |
|
|
10
|
+
| [Core Concepts](core-concepts.md) | Client-Manager-Model pattern, entity IDs, immutable models |
|
|
11
|
+
| [Entity CRUD Operations](entities.md) | Create, read, update, and delete entities |
|
|
12
|
+
| [Entity Types Reference](entity-types-reference.md) | All 12 entity types with their specific fields |
|
|
13
|
+
| [Posts](posts.md) | Attach notes and comments to any entity |
|
|
14
|
+
| [Search and Filtering](search-and-filtering.md) | Global search, entities endpoint, list filters |
|
|
15
|
+
| [Pagination](pagination.md) | Navigate large result sets |
|
|
16
|
+
| [Assets and Images](assets-and-images.md) | File/link/alias assets, entity images, automatic image management |
|
|
17
|
+
| [Campaign Gallery](gallery.md) | Campaign-level image storage |
|
|
18
|
+
| [Error Handling](error-handling.md) | Exception types and recommended patterns |
|
|
19
|
+
| [Rate Limiting](rate-limiting.md) | Automatic retry behavior and configuration |
|
|
20
|
+
| [Debug Mode](debug-mode.md) | Request/response logging for troubleshooting |
|
|
21
|
+
| [Known Limitations](known-limitations.md) | API quirks and gotchas |
|
|
22
|
+
|
|
23
|
+
## Reference
|
|
24
|
+
|
|
25
|
+
| Page | Description |
|
|
26
|
+
|------|-------------|
|
|
27
|
+
| [API Reference](api-reference.md) | Complete reference for all classes, methods, and models |
|
|
28
|
+
|
|
29
|
+
## Quick Example
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from kanka import KankaClient
|
|
33
|
+
|
|
34
|
+
client = KankaClient(token="your-token", campaign_id=12345)
|
|
35
|
+
|
|
36
|
+
# Create a character
|
|
37
|
+
character = client.characters.create(
|
|
38
|
+
name="Gandalf",
|
|
39
|
+
type="Wizard",
|
|
40
|
+
title="The Grey",
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Search across all entities
|
|
44
|
+
results = client.search("dragon")
|
|
45
|
+
|
|
46
|
+
# List with filters
|
|
47
|
+
npcs = client.characters.list(type="NPC", is_private=False)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Links
|
|
51
|
+
|
|
52
|
+
- [Kanka.io](https://kanka.io) — The Kanka platform
|
|
53
|
+
- [Kanka API Docs](https://app.kanka.io/api-docs/1.0) — Official API documentation
|
|
54
|
+
- [GitHub Repository](https://github.com/ervwalter/python-kanka) — Source code
|
|
55
|
+
- [PyPI](https://pypi.org/project/python-kanka/) — Package page
|