python-kanka 2.0.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.
Files changed (79) hide show
  1. python_kanka-2.0.0/.bumpversion.cfg +10 -0
  2. python_kanka-2.0.0/.github/workflows/ci.yml +56 -0
  3. python_kanka-2.0.0/.github/workflows/publish.yml +94 -0
  4. python_kanka-2.0.0/.gitignore +177 -0
  5. python_kanka-2.0.0/.pre-commit-config.yaml +33 -0
  6. python_kanka-2.0.0/API_REFERENCE.md +688 -0
  7. python_kanka-2.0.0/CHANGELOG.md +24 -0
  8. python_kanka-2.0.0/CLAUDE.md +142 -0
  9. python_kanka-2.0.0/LICENSE +21 -0
  10. python_kanka-2.0.0/MANIFEST.in +31 -0
  11. python_kanka-2.0.0/Makefile +61 -0
  12. python_kanka-2.0.0/PKG-INFO +377 -0
  13. python_kanka-2.0.0/PUBLISHING.md +167 -0
  14. python_kanka-2.0.0/README.md +322 -0
  15. python_kanka-2.0.0/dev-requirements.txt +20 -0
  16. python_kanka-2.0.0/examples/crud_operations.py +236 -0
  17. python_kanka-2.0.0/examples/error_handling.py +246 -0
  18. python_kanka-2.0.0/examples/filtering.py +186 -0
  19. python_kanka-2.0.0/examples/migration.py +419 -0
  20. python_kanka-2.0.0/examples/posts.py +167 -0
  21. python_kanka-2.0.0/examples/quickstart.py +135 -0
  22. python_kanka-2.0.0/pyproject.toml +129 -0
  23. python_kanka-2.0.0/pytest.ini +17 -0
  24. python_kanka-2.0.0/requirements.txt +3 -0
  25. python_kanka-2.0.0/setup.cfg +4 -0
  26. python_kanka-2.0.0/setup.py +72 -0
  27. python_kanka-2.0.0/src/kanka/__init__.py +90 -0
  28. python_kanka-2.0.0/src/kanka/_version.py +3 -0
  29. python_kanka-2.0.0/src/kanka/client.py +540 -0
  30. python_kanka-2.0.0/src/kanka/exceptions.py +132 -0
  31. python_kanka-2.0.0/src/kanka/managers.py +464 -0
  32. python_kanka-2.0.0/src/kanka/models/__init__.py +58 -0
  33. python_kanka-2.0.0/src/kanka/models/base.py +91 -0
  34. python_kanka-2.0.0/src/kanka/models/common.py +175 -0
  35. python_kanka-2.0.0/src/kanka/models/entities.py +349 -0
  36. python_kanka-2.0.0/src/kanka/py.typed +2 -0
  37. python_kanka-2.0.0/src/kanka/types.py +8 -0
  38. python_kanka-2.0.0/src/python_kanka.egg-info/PKG-INFO +377 -0
  39. python_kanka-2.0.0/src/python_kanka.egg-info/SOURCES.txt +77 -0
  40. python_kanka-2.0.0/src/python_kanka.egg-info/dependency_links.txt +1 -0
  41. python_kanka-2.0.0/src/python_kanka.egg-info/not-zip-safe +1 -0
  42. python_kanka-2.0.0/src/python_kanka.egg-info/requires.txt +13 -0
  43. python_kanka-2.0.0/src/python_kanka.egg-info/top_level.txt +1 -0
  44. python_kanka-2.0.0/tests/__init__.py +1 -0
  45. python_kanka-2.0.0/tests/integration/README.md +172 -0
  46. python_kanka-2.0.0/tests/integration/__init__.py +5 -0
  47. python_kanka-2.0.0/tests/integration/base.py +128 -0
  48. python_kanka-2.0.0/tests/integration/full_test_output_fixed.txt +442 -0
  49. python_kanka-2.0.0/tests/integration/run_integration_tests.py +250 -0
  50. python_kanka-2.0.0/tests/integration/setup_test_env.py +43 -0
  51. python_kanka-2.0.0/tests/integration/test_calendars_integration.py +286 -0
  52. python_kanka-2.0.0/tests/integration/test_calendars_simple.py +98 -0
  53. python_kanka-2.0.0/tests/integration/test_characters_integration.py +250 -0
  54. python_kanka-2.0.0/tests/integration/test_creatures_integration.py +259 -0
  55. python_kanka-2.0.0/tests/integration/test_entities_api_integration.py +441 -0
  56. python_kanka-2.0.0/tests/integration/test_entity_tags_integration.py +369 -0
  57. python_kanka-2.0.0/tests/integration/test_events_integration.py +252 -0
  58. python_kanka-2.0.0/tests/integration/test_families_integration.py +273 -0
  59. python_kanka-2.0.0/tests/integration/test_journals_integration.py +262 -0
  60. python_kanka-2.0.0/tests/integration/test_locations_integration.py +218 -0
  61. python_kanka-2.0.0/tests/integration/test_mentions_integration.py +219 -0
  62. python_kanka-2.0.0/tests/integration/test_notes_integration.py +204 -0
  63. python_kanka-2.0.0/tests/integration/test_organisations_integration.py +237 -0
  64. python_kanka-2.0.0/tests/integration/test_posts_integration.py +284 -0
  65. python_kanka-2.0.0/tests/integration/test_quests_integration.py +284 -0
  66. python_kanka-2.0.0/tests/integration/test_races_integration.py +230 -0
  67. python_kanka-2.0.0/tests/integration/test_rate_limiting.py +196 -0
  68. python_kanka-2.0.0/tests/integration/test_search_integration.py +432 -0
  69. python_kanka-2.0.0/tests/integration/test_tag_colour.py +152 -0
  70. python_kanka-2.0.0/tests/integration/test_tags_integration.py +238 -0
  71. python_kanka-2.0.0/tests/mypy.ini +6 -0
  72. python_kanka-2.0.0/tests/test_client.py +261 -0
  73. python_kanka-2.0.0/tests/test_client_advanced.py +463 -0
  74. python_kanka-2.0.0/tests/test_entity_models.py +377 -0
  75. python_kanka-2.0.0/tests/test_exceptions.py +91 -0
  76. python_kanka-2.0.0/tests/test_managers.py +459 -0
  77. python_kanka-2.0.0/tests/test_models.py +318 -0
  78. python_kanka-2.0.0/tests/test_models_advanced.py +332 -0
  79. python_kanka-2.0.0/tests/utils.py +243 -0
@@ -0,0 +1,10 @@
1
+ [bumpversion]
2
+ current_version = 2.0.0
3
+ commit = True
4
+ tag = True
5
+ tag_name = v{new_version}
6
+ message = Bump version: {current_version} → {new_version}
7
+
8
+ [bumpversion:file:src/kanka/_version.py]
9
+ search = __version__ = "{current_version}"
10
+ replace = __version__ = "{new_version}"
@@ -0,0 +1,56 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, master, develop ]
6
+ pull_request:
7
+ branches: [ main, master, develop ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+
25
+ - name: Cache pip dependencies
26
+ uses: actions/cache@v4
27
+ with:
28
+ path: ~/.cache/pip
29
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/dev-requirements.txt') }}
30
+ restore-keys: |
31
+ ${{ runner.os }}-pip-
32
+
33
+ - name: Install dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ pip install -r requirements.txt
37
+ pip install -r dev-requirements.txt
38
+ pip install -e .
39
+
40
+ - name: Run all quality checks
41
+ run: |
42
+ make check
43
+
44
+ - name: Generate coverage report
45
+ if: matrix.python-version == '3.11'
46
+ run: |
47
+ make coverage
48
+
49
+ - name: Upload coverage reports to Codecov
50
+ if: matrix.python-version == '3.11'
51
+ uses: codecov/codecov-action@v5
52
+ env:
53
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
54
+ with:
55
+ file: ./coverage.xml
56
+ fail_ci_if_error: false
@@ -0,0 +1,94 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ test_pypi:
9
+ description: 'Publish to Test PyPI instead of PyPI'
10
+ required: false
11
+ default: true
12
+ type: boolean
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install -r requirements.txt
33
+ pip install -r dev-requirements.txt
34
+ pip install -e .
35
+
36
+ - name: Run all quality checks
37
+ run: |
38
+ make check
39
+
40
+ build:
41
+ needs: test
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+
46
+ - name: Set up Python
47
+ uses: actions/setup-python@v5
48
+ with:
49
+ python-version: '3.11'
50
+
51
+ - name: Install build dependencies
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ pip install build twine
55
+
56
+ - name: Build package
57
+ run: python -m build
58
+
59
+ - name: Check package
60
+ run: twine check dist/*
61
+
62
+ - name: Upload artifacts
63
+ uses: actions/upload-artifact@v4
64
+ with:
65
+ name: dist
66
+ path: dist/
67
+
68
+ publish:
69
+ needs: build
70
+ runs-on: ubuntu-latest
71
+ if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
72
+
73
+ permissions:
74
+ id-token: write # For trusted publishing
75
+
76
+ steps:
77
+ - name: Download artifacts
78
+ uses: actions/download-artifact@v4
79
+ with:
80
+ name: dist
81
+ path: dist/
82
+
83
+ - name: Publish to Test PyPI
84
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi == 'true'
85
+ uses: pypa/gh-action-pypi-publish@release/v1
86
+ with:
87
+ repository-url: https://test.pypi.org/legacy/
88
+ skip-existing: true
89
+
90
+ - name: Publish to PyPI
91
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi == 'false')
92
+ uses: pypa/gh-action-pypi-publish@release/v1
93
+ with:
94
+ skip-existing: true
@@ -0,0 +1,177 @@
1
+ # vscode stuff
2
+ .vscode/
3
+
4
+ # sphinx documentation
5
+ docs/source/_*
6
+ docs/make.bat
7
+ docs/Makefile
8
+
9
+ # Byte-compiled / optimized / DLL files
10
+ __pycache__/
11
+ *.py[cod]
12
+ *$py.class
13
+
14
+ # C extensions
15
+ *.so
16
+
17
+ # Distribution / packaging
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ pip-wheel-metadata/
32
+ share/python-wheels/
33
+ *.egg-info/
34
+ .installed.cfg
35
+ *.egg
36
+ MANIFEST
37
+
38
+ # PyInstaller
39
+ # Usually these files are written by a python script from a template
40
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
41
+ *.manifest
42
+ *.spec
43
+
44
+ # Installer logs
45
+ pip-log.txt
46
+ pip-delete-this-directory.txt
47
+
48
+ # Unit test / coverage reports
49
+ htmlcov/
50
+ .tox/
51
+ .nox/
52
+ .coverage
53
+ .coverage.*
54
+ .cache
55
+ nosetests.xml
56
+ coverage.xml
57
+ *.cover
58
+ *.py,cover
59
+ .hypothesis/
60
+ .pytest_cache/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ target/
84
+
85
+ # Jupyter Notebook
86
+ .ipynb_checkpoints
87
+
88
+ # IPython
89
+ profile_default/
90
+ ipython_config.py
91
+
92
+ # pyenv
93
+ .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
103
+ __pypackages__/
104
+
105
+ # Celery stuff
106
+ celerybeat-schedule
107
+ celerybeat.pid
108
+
109
+ # SageMath parsed files
110
+ *.sage.py
111
+
112
+ # Environments
113
+ .env
114
+ .venv
115
+ env/
116
+ venv/
117
+ ENV/
118
+ env.bak/
119
+ venv.bak/
120
+
121
+ # Spyder project settings
122
+ .spyderproject
123
+ .spyproject
124
+
125
+ # Rope project settings
126
+ .ropeproject
127
+
128
+ # mkdocs documentation
129
+ /site
130
+
131
+ # mypy
132
+ .mypy_cache/
133
+ .dmypy.json
134
+ dmypy.json
135
+
136
+ # Pyre type checker
137
+ .pyre/
138
+
139
+ # Ruff
140
+ .ruff_cache/
141
+
142
+ # Coverage reports
143
+ htmlcov/
144
+ .coverage
145
+ .coverage.*
146
+ *.cover
147
+ coverage.xml
148
+ *.lcov
149
+
150
+ # pytest
151
+ .pytest_cache/
152
+ pytest_cache/
153
+
154
+ # mypy
155
+ .mypy_cache/
156
+ .dmypy.json
157
+ dmypy.json
158
+
159
+ # IDEs
160
+ .idea/
161
+ *.swp
162
+ *.swo
163
+ *~
164
+
165
+ # OS
166
+ .DS_Store
167
+ Thumbs.db
168
+
169
+ # Integration test files
170
+ tests/integration/.env
171
+ tests/integration/*.log
172
+
173
+ # Test output files
174
+ *_test_output.txt
175
+ *_output.txt
176
+ test_api_response.py
177
+ claude-notes
@@ -0,0 +1,33 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v4.5.0
6
+ hooks:
7
+ - id: trailing-whitespace
8
+ - id: end-of-file-fixer
9
+ - id: check-yaml
10
+ - id: check-added-large-files
11
+ - id: check-json
12
+ - id: check-merge-conflict
13
+ - id: check-toml
14
+ - id: debug-statements
15
+ - id: mixed-line-ending
16
+
17
+ - repo: https://github.com/psf/black
18
+ rev: 23.12.1
19
+ hooks:
20
+ - id: black
21
+ language_version: python3
22
+
23
+ - repo: https://github.com/pycqa/isort
24
+ rev: 5.13.2
25
+ hooks:
26
+ - id: isort
27
+ args: ["--profile", "black"]
28
+
29
+ - repo: https://github.com/astral-sh/ruff-pre-commit
30
+ rev: v0.1.9
31
+ hooks:
32
+ - id: ruff
33
+ args: ["--fix", "--exit-non-zero-on-fix"]