lorebase-client 0.2.3__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.
- lorebase_client-0.2.3/.gitignore +79 -0
- lorebase_client-0.2.3/PKG-INFO +7 -0
- lorebase_client-0.2.3/pyproject.toml +18 -0
- lorebase_client-0.2.3/src/lorebase_client/__init__.py +86 -0
- lorebase_client-0.2.3/src/lorebase_client/aclient.py +1585 -0
- lorebase_client-0.2.3/src/lorebase_client/client.py +1587 -0
- lorebase_client-0.2.3/src/lorebase_client/config.py +160 -0
- lorebase_client-0.2.3/src/lorebase_client/core.py +330 -0
- lorebase_client-0.2.3/src/lorebase_client/endpoints.py +1292 -0
- lorebase_client-0.2.3/src/lorebase_client/errors.py +242 -0
- lorebase_client-0.2.3/src/lorebase_client/models.py +1662 -0
- lorebase_client-0.2.3/src/lorebase_client/py.typed +0 -0
- lorebase_client-0.2.3/tests/integration/conftest.py +59 -0
- lorebase_client-0.2.3/tests/integration/test_flow.py +422 -0
- lorebase_client-0.2.3/tests/test_contract.py +423 -0
- lorebase_client-0.2.3/tests/test_errors_and_config.py +165 -0
- lorebase_client-0.2.3/tests/test_path_segments.py +31 -0
- lorebase_client-0.2.3/tests/test_requests.py +1460 -0
- lorebase_client-0.2.3/tests/test_trace.py +223 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.eggs/
|
|
11
|
+
.venv/
|
|
12
|
+
venv/
|
|
13
|
+
.python-eggs/
|
|
14
|
+
pip-wheel-metadata/
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.mypy_cache/
|
|
17
|
+
.ruff_cache/
|
|
18
|
+
.pyre/
|
|
19
|
+
.pytype/
|
|
20
|
+
.hypothesis/
|
|
21
|
+
.coverage
|
|
22
|
+
.coverage.*
|
|
23
|
+
coverage.xml
|
|
24
|
+
htmlcov/
|
|
25
|
+
.tox/
|
|
26
|
+
.nox/
|
|
27
|
+
*.prof
|
|
28
|
+
|
|
29
|
+
# Node
|
|
30
|
+
node_modules/
|
|
31
|
+
.pnpm-store/
|
|
32
|
+
.npm/
|
|
33
|
+
.yarn/
|
|
34
|
+
!.yarn/releases
|
|
35
|
+
.pnp.*
|
|
36
|
+
npm-debug.log*
|
|
37
|
+
yarn-debug.log*
|
|
38
|
+
yarn-error.log*
|
|
39
|
+
pnpm-debug.log*
|
|
40
|
+
.vite/
|
|
41
|
+
*.tsbuildinfo
|
|
42
|
+
apps/web/dist/
|
|
43
|
+
apps/web/.vitest/
|
|
44
|
+
|
|
45
|
+
# Environment and secrets
|
|
46
|
+
.env
|
|
47
|
+
.env.*
|
|
48
|
+
!.env.example
|
|
49
|
+
*.pem
|
|
50
|
+
*.key
|
|
51
|
+
secrets/
|
|
52
|
+
|
|
53
|
+
# Docker
|
|
54
|
+
docker-compose.override.yaml
|
|
55
|
+
docker-compose.override.yml
|
|
56
|
+
.docker/
|
|
57
|
+
|
|
58
|
+
# Data and local artifacts
|
|
59
|
+
*.sqlite
|
|
60
|
+
*.db
|
|
61
|
+
/tmp/
|
|
62
|
+
/data/
|
|
63
|
+
tests/perf/results/
|
|
64
|
+
|
|
65
|
+
# Editors and OS
|
|
66
|
+
.idea/
|
|
67
|
+
.vscode/*
|
|
68
|
+
!.vscode/extensions.json
|
|
69
|
+
!.vscode/settings.example.json
|
|
70
|
+
*.swp
|
|
71
|
+
*.swo
|
|
72
|
+
*~
|
|
73
|
+
.DS_Store
|
|
74
|
+
Thumbs.db
|
|
75
|
+
*.code-workspace
|
|
76
|
+
.history/
|
|
77
|
+
|
|
78
|
+
# Session worktrees
|
|
79
|
+
.claude/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "lorebase-client"
|
|
3
|
+
version = "0.2.3"
|
|
4
|
+
description = "Lorebase client: typed sync and async HTTP client for the Keeper API"
|
|
5
|
+
requires-python = ">=3.12"
|
|
6
|
+
dependencies = [
|
|
7
|
+
# Transport: one HTTP stack with sync and async clients and pluggable transports.
|
|
8
|
+
"httpx>=0.27",
|
|
9
|
+
# Typed request and response models.
|
|
10
|
+
"pydantic>=2.7",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = ["hatchling"]
|
|
15
|
+
build-backend = "hatchling.build"
|
|
16
|
+
|
|
17
|
+
[tool.hatch.build.targets.wheel]
|
|
18
|
+
packages = ["src/lorebase_client"]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""Lorebase client: typed sync and async HTTP clients for the Keeper API.
|
|
2
|
+
|
|
3
|
+
from lorebase_client import LorebaseClient
|
|
4
|
+
|
|
5
|
+
client = LorebaseClient() # LOREBASE_URL, LOREBASE_API_KEY or LOREBASE_TOKEN
|
|
6
|
+
print(client.whoami())
|
|
7
|
+
|
|
8
|
+
The package depends on `httpx` and `pydantic` only.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from lorebase_client.aclient import AsyncLorebaseClient
|
|
12
|
+
from lorebase_client.client import LorebaseClient
|
|
13
|
+
from lorebase_client.config import (
|
|
14
|
+
ENV_API_KEY,
|
|
15
|
+
ENV_API_PREFIX,
|
|
16
|
+
ENV_TIMEOUT,
|
|
17
|
+
ENV_TOKEN,
|
|
18
|
+
ENV_URL,
|
|
19
|
+
ClientConfig,
|
|
20
|
+
RetryPolicy,
|
|
21
|
+
resolve_config,
|
|
22
|
+
)
|
|
23
|
+
from lorebase_client.core import Call, ETagCache, new_idempotency_key
|
|
24
|
+
from lorebase_client.errors import (
|
|
25
|
+
AlreadyExistsError,
|
|
26
|
+
ApiError,
|
|
27
|
+
AuthenticationError,
|
|
28
|
+
BadRequestError,
|
|
29
|
+
BranchBusyError,
|
|
30
|
+
ConflictError,
|
|
31
|
+
IdempotencyConflictError,
|
|
32
|
+
LorebaseConfigError,
|
|
33
|
+
LorebaseConnectionError,
|
|
34
|
+
LorebaseError,
|
|
35
|
+
NotFoundError,
|
|
36
|
+
PayloadTooLargeError,
|
|
37
|
+
PermissionDeniedError,
|
|
38
|
+
ProtectedBranchError,
|
|
39
|
+
RateLimitedError,
|
|
40
|
+
ReviewRequiredError,
|
|
41
|
+
ServerError,
|
|
42
|
+
StaleHeadError,
|
|
43
|
+
UnavailableError,
|
|
44
|
+
ValidationFailedError,
|
|
45
|
+
error_from_response,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
__version__ = "0.2.3"
|
|
49
|
+
|
|
50
|
+
__all__ = [
|
|
51
|
+
"ENV_API_KEY",
|
|
52
|
+
"ENV_API_PREFIX",
|
|
53
|
+
"ENV_TIMEOUT",
|
|
54
|
+
"ENV_TOKEN",
|
|
55
|
+
"ENV_URL",
|
|
56
|
+
"AlreadyExistsError",
|
|
57
|
+
"ApiError",
|
|
58
|
+
"AsyncLorebaseClient",
|
|
59
|
+
"AuthenticationError",
|
|
60
|
+
"BadRequestError",
|
|
61
|
+
"BranchBusyError",
|
|
62
|
+
"Call",
|
|
63
|
+
"ClientConfig",
|
|
64
|
+
"ConflictError",
|
|
65
|
+
"ETagCache",
|
|
66
|
+
"IdempotencyConflictError",
|
|
67
|
+
"LorebaseClient",
|
|
68
|
+
"LorebaseConfigError",
|
|
69
|
+
"LorebaseConnectionError",
|
|
70
|
+
"LorebaseError",
|
|
71
|
+
"NotFoundError",
|
|
72
|
+
"PayloadTooLargeError",
|
|
73
|
+
"PermissionDeniedError",
|
|
74
|
+
"ProtectedBranchError",
|
|
75
|
+
"RateLimitedError",
|
|
76
|
+
"RetryPolicy",
|
|
77
|
+
"ReviewRequiredError",
|
|
78
|
+
"ServerError",
|
|
79
|
+
"StaleHeadError",
|
|
80
|
+
"UnavailableError",
|
|
81
|
+
"ValidationFailedError",
|
|
82
|
+
"__version__",
|
|
83
|
+
"error_from_response",
|
|
84
|
+
"new_idempotency_key",
|
|
85
|
+
"resolve_config",
|
|
86
|
+
]
|