karakeep-python-api 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
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.
- karakeep_python_api/__main__.py +9 -4
- karakeep_python_api/karakeep_api.py +4 -16
- {karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/METADATA +1 -1
- karakeep_python_api-0.1.5.dist-info/RECORD +11 -0
- karakeep_python_api-0.1.3.dist-info/RECORD +0 -11
- {karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/WHEEL +0 -0
- {karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/entry_points.txt +0 -0
- {karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/top_level.txt +0 -0
karakeep_python_api/__main__.py
CHANGED
|
@@ -35,7 +35,6 @@ def serialize_output(data: Any) -> Any:
|
|
|
35
35
|
) # Use Pydantic's built-in JSON serialization
|
|
36
36
|
elif isinstance(data, list):
|
|
37
37
|
return [serialize_output(item) for item in data]
|
|
38
|
-
# Removed dataclass handling as API uses Pydantic models primarily
|
|
39
38
|
elif isinstance(data, dict):
|
|
40
39
|
# Serialize dictionary values
|
|
41
40
|
return {k: serialize_output(v) for k, v in data.items()}
|
|
@@ -177,7 +176,15 @@ def cli(ctx, base_url, api_key, verify_ssl, verbose, disable_response_validation
|
|
|
177
176
|
# --- Configure Logger ---
|
|
178
177
|
log_level = "DEBUG" if verbose else "INFO"
|
|
179
178
|
logger.remove() # Remove default handler
|
|
180
|
-
|
|
179
|
+
if verbose:
|
|
180
|
+
logger.add(
|
|
181
|
+
sys.stderr,
|
|
182
|
+
level=log_level,
|
|
183
|
+
format="<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
|
|
184
|
+
)
|
|
185
|
+
logger.debug("Verbose logging enabled with detailed format.")
|
|
186
|
+
else:
|
|
187
|
+
logger.add(sys.stderr, level=log_level) # Default format for INFO
|
|
181
188
|
logger.debug("Logger configured for level: {}", log_level)
|
|
182
189
|
logger.debug("CLI context initialized.")
|
|
183
190
|
|
|
@@ -345,7 +352,6 @@ def create_click_command(
|
|
|
345
352
|
full_help = docstring
|
|
346
353
|
|
|
347
354
|
# tweak the whitespaces in the full help:
|
|
348
|
-
# full_help = full_help.replace("\n", "\n\n").replace("\n ", " ")
|
|
349
355
|
full_help = full_help.replace("\n ", " ")
|
|
350
356
|
full_help = full_help.replace("\n", "\n\n")
|
|
351
357
|
|
|
@@ -452,7 +458,6 @@ def create_click_command(
|
|
|
452
458
|
elif isinstance(click_type, click.Choice):
|
|
453
459
|
param_help += f" (Choices: {', '.join(click_type.choices)})"
|
|
454
460
|
|
|
455
|
-
# Standard parameter handling (no special '--data' mapping anymore)
|
|
456
461
|
click_required = is_required_in_sig and default_value is None and not is_flag
|
|
457
462
|
|
|
458
463
|
# Add the Click Option
|
|
@@ -85,7 +85,7 @@ class KarakeepAPI:
|
|
|
85
85
|
"""
|
|
86
86
|
|
|
87
87
|
# Version reflects the client library version, updated by bumpver
|
|
88
|
-
VERSION: str = "0.1.
|
|
88
|
+
VERSION: str = "0.1.5"
|
|
89
89
|
|
|
90
90
|
def __init__(
|
|
91
91
|
self,
|
|
@@ -94,7 +94,6 @@ class KarakeepAPI:
|
|
|
94
94
|
openapi_spec_path: Optional[str] = None, # Allow None, default handled below
|
|
95
95
|
verify_ssl: bool = True,
|
|
96
96
|
verbose: bool = False,
|
|
97
|
-
strict_response_parsing: bool = False, # Kept for potential future use
|
|
98
97
|
disable_response_validation: Optional[bool] = None,
|
|
99
98
|
):
|
|
100
99
|
"""
|
|
@@ -112,7 +111,6 @@ class KarakeepAPI:
|
|
|
112
111
|
Can be overridden with KARAKEEP_PYTHON_API_VERIFY_SSL environment variable (true/false).
|
|
113
112
|
verbose: Enable verbose logging (default: False).
|
|
114
113
|
Can be overridden with KARAKEEP_PYTHON_API_VERBOSE environment variable (true/false).
|
|
115
|
-
strict_response_parsing: (Currently unused) If True, raise an APIError when response parsing fails.
|
|
116
114
|
disable_response_validation: If True, skip Pydantic validation of API responses and return raw data.
|
|
117
115
|
Defaults to False. Can be overridden by setting the
|
|
118
116
|
KARAKEEP_PYTHON_API_DISABLE_RESPONSE_VALIDATION environment variable to "true".
|
|
@@ -206,9 +204,6 @@ class KarakeepAPI:
|
|
|
206
204
|
|
|
207
205
|
self.verify_ssl = verify_ssl
|
|
208
206
|
self.verbose = verbose
|
|
209
|
-
self.strict_response_parsing = (
|
|
210
|
-
strict_response_parsing # Currently unused but kept
|
|
211
|
-
)
|
|
212
207
|
self.last_request_time: float = time.monotonic() # Initialize timestamp for rate limiting
|
|
213
208
|
|
|
214
209
|
# --- Response Validation Setting ---
|
|
@@ -227,16 +222,9 @@ class KarakeepAPI:
|
|
|
227
222
|
f"Response validation set to {not self.disable_response_validation} via environment variable (KARAKEEP_PYTHON_API_DISABLE_RESPONSE_VALIDATION={env_disable_validation})."
|
|
228
223
|
)
|
|
229
224
|
|
|
230
|
-
#
|
|
231
|
-
if
|
|
232
|
-
|
|
233
|
-
sys.stderr,
|
|
234
|
-
level="DEBUG",
|
|
235
|
-
format="<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
|
|
236
|
-
)
|
|
237
|
-
logger.info("Verbose logging enabled.")
|
|
238
|
-
else:
|
|
239
|
-
logger.add(sys.stderr, level="INFO") # Default level
|
|
225
|
+
# Logger configuration is now handled by the calling application (e.g., __main__.py)
|
|
226
|
+
# or defaults to loguru's standard setup if KarakeepAPI is used as a library.
|
|
227
|
+
# self.verbose is still used for conditional logging within the class methods.
|
|
240
228
|
|
|
241
229
|
logger.debug("KarakeepAPI client initialized.")
|
|
242
230
|
logger.debug(f" Base URL: {self.api_base_url}")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
karakeep_python_api/__init__.py,sha256=qk3MeIIvnCNAyYzJrv8dMKVXvA4ejLU3mhB3xFzdLDY,606
|
|
2
|
+
karakeep_python_api/__main__.py,sha256=ekZWuP_zKo0eIJK2OxDU_cVRYuHxO1j-t_DBP9TrSOY,24439
|
|
3
|
+
karakeep_python_api/datatypes.py,sha256=nVuaFB-BaNcTdzNqLvHBG0OlgoXdi0NxL0Rr_jqOPao,4189
|
|
4
|
+
karakeep_python_api/karakeep_api.py,sha256=81nNzI_TnO6an9JqLGyXzFwh1KFFRZ13R6spOndoQj0,72573
|
|
5
|
+
karakeep_python_api/openapi_reference.json,sha256=SqhEHE526dmsw07b3YkRkfhiyO6-BjCvFHpR5-l6dyU,77103
|
|
6
|
+
karakeep_python_api-0.1.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
+
karakeep_python_api-0.1.5.dist-info/METADATA,sha256=2qqRQolCJChQWCcpzwdGzavh5Lho7IXjI_xHZgRKU1k,12211
|
|
8
|
+
karakeep_python_api-0.1.5.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
9
|
+
karakeep_python_api-0.1.5.dist-info/entry_points.txt,sha256=n0leQp_IX2NivoWuUcaR9ZHwAvl_6yt-NcHWuCJyxNo,62
|
|
10
|
+
karakeep_python_api-0.1.5.dist-info/top_level.txt,sha256=X3VKqh9YAbPQp144db0Ko2C5Q2y6-nwpPgtnuCiSDmU,20
|
|
11
|
+
karakeep_python_api-0.1.5.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
karakeep_python_api/__init__.py,sha256=qk3MeIIvnCNAyYzJrv8dMKVXvA4ejLU3mhB3xFzdLDY,606
|
|
2
|
-
karakeep_python_api/__main__.py,sha256=LWRNJpo9I0J-K-bNXPuQDCIR5s3YrePWmsONW2uz8fY,24272
|
|
3
|
-
karakeep_python_api/datatypes.py,sha256=nVuaFB-BaNcTdzNqLvHBG0OlgoXdi0NxL0Rr_jqOPao,4189
|
|
4
|
-
karakeep_python_api/karakeep_api.py,sha256=hljMNPoFsRvniRNEjj6jV6A9YupwYlVB74qgyx58CTM,73109
|
|
5
|
-
karakeep_python_api/openapi_reference.json,sha256=SqhEHE526dmsw07b3YkRkfhiyO6-BjCvFHpR5-l6dyU,77103
|
|
6
|
-
karakeep_python_api-0.1.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
-
karakeep_python_api-0.1.3.dist-info/METADATA,sha256=aqy5O2_7e79TzalE5uHTiIz2hz2FubGAE_NxRMwYXqc,12211
|
|
8
|
-
karakeep_python_api-0.1.3.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
9
|
-
karakeep_python_api-0.1.3.dist-info/entry_points.txt,sha256=n0leQp_IX2NivoWuUcaR9ZHwAvl_6yt-NcHWuCJyxNo,62
|
|
10
|
-
karakeep_python_api-0.1.3.dist-info/top_level.txt,sha256=X3VKqh9YAbPQp144db0Ko2C5Q2y6-nwpPgtnuCiSDmU,20
|
|
11
|
-
karakeep_python_api-0.1.3.dist-info/RECORD,,
|
|
File without changes
|
{karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{karakeep_python_api-0.1.3.dist-info → karakeep_python_api-0.1.5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|