karakeep-python-api 0.1.2__py3-none-any.whl → 0.1.4__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 +0 -3
- karakeep_python_api/karakeep_api.py +6 -6
- karakeep_python_api/openapi_reference.json +1 -1
- {karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/METADATA +41 -38
- karakeep_python_api-0.1.4.dist-info/RECORD +11 -0
- karakeep_python_api-0.1.2.dist-info/RECORD +0 -11
- {karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/WHEEL +0 -0
- {karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/entry_points.txt +0 -0
- {karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.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()}
|
|
@@ -345,7 +344,6 @@ def create_click_command(
|
|
|
345
344
|
full_help = docstring
|
|
346
345
|
|
|
347
346
|
# tweak the whitespaces in the full help:
|
|
348
|
-
# full_help = full_help.replace("\n", "\n\n").replace("\n ", " ")
|
|
349
347
|
full_help = full_help.replace("\n ", " ")
|
|
350
348
|
full_help = full_help.replace("\n", "\n\n")
|
|
351
349
|
|
|
@@ -452,7 +450,6 @@ def create_click_command(
|
|
|
452
450
|
elif isinstance(click_type, click.Choice):
|
|
453
451
|
param_help += f" (Choices: {', '.join(click_type.choices)})"
|
|
454
452
|
|
|
455
|
-
# Standard parameter handling (no special '--data' mapping anymore)
|
|
456
453
|
click_required = is_required_in_sig and default_value is None and not is_flag
|
|
457
454
|
|
|
458
455
|
# 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.4"
|
|
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 ---
|
|
@@ -1435,6 +1430,11 @@ class KarakeepAPI:
|
|
|
1435
1430
|
logger.debug("Skipping response validation as requested.")
|
|
1436
1431
|
return response_data
|
|
1437
1432
|
else:
|
|
1433
|
+
# As of version 0.24.1 of karakeep: we do not check the correct
|
|
1434
|
+
# validation type because there is an error on the
|
|
1435
|
+
# server side: https://github.com/karakeep-app/karakeep/issues/1365
|
|
1436
|
+
return response_data
|
|
1437
|
+
|
|
1438
1438
|
# Response should match Tag1 schema
|
|
1439
1439
|
return datatypes.Tag1.model_validate(response_data)
|
|
1440
1440
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: karakeep_python_api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Community python client for the Karakeep API.
|
|
5
5
|
Home-page: https://github.com/thiswillbeyourgithub/karakeep_python_api/
|
|
6
6
|
License: GPLv3
|
|
@@ -72,43 +72,46 @@ The development process involved:
|
|
|
72
72
|
|
|
73
73
|
## API Method Coverage
|
|
74
74
|
|
|
75
|
-
The following table lists the public methods available in the `KarakeepAPI` class
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
75
|
+
The following table lists the public methods available in the `KarakeepAPI` class.
|
|
76
|
+
* The "Pytest" column indicates whether the Python library method is covered by the automated test suite (`tests/test_karakeep_api.py`).
|
|
77
|
+
* The "CLI" column indicates whether the corresponding CLI command for that method is tested within the Pytest suite (typically via `subprocess`).
|
|
78
|
+
Methods or CLI commands marked with ❌ should be used with caution as their behavior has not been automatically verified within the test suite.
|
|
79
|
+
|
|
80
|
+
| Method Name | Pytest | CLI | Remarks |
|
|
81
|
+
| -------------------------------- | :----: | :--: | -------------------------------------------- |
|
|
82
|
+
| `get_all_bookmarks` | ✅ | ✅ | Tested with pagination. |
|
|
83
|
+
| `create_a_new_bookmark` | ✅ | ❌ | Pytest for `type="link"` via fixture. CLI not directly tested. |
|
|
84
|
+
| `search_bookmarks` | ✅ | ✅ | Seems to be nondeterministic and fails if using more than 3 words |
|
|
85
|
+
| `get_a_single_bookmark` | ✅ | ❌ | |
|
|
86
|
+
| `delete_a_bookmark` | ✅ | ❌ | |
|
|
87
|
+
| `update_a_bookmark` | ✅ | ✅ | Tested for title updates. |
|
|
88
|
+
| `summarize_a_bookmark` | ❌ | ❌ | |
|
|
89
|
+
| `attach_tags_to_a_bookmark` | ✅ | ❌ | |
|
|
90
|
+
| `detach_tags_from_a_bookmark` | ✅ | ❌ | |
|
|
91
|
+
| `get_highlights_of_a_bookmark` | ❌ | ❌ | Works from the CLI; not yet added to Pytest. |
|
|
92
|
+
| `attach_asset` | ❌ | ❌ | |
|
|
93
|
+
| `replace_asset` | ❌ | ❌ | |
|
|
94
|
+
| `detach_asset` | ❌ | ❌ | |
|
|
95
|
+
| `get_all_lists` | ✅ | ✅ | |
|
|
96
|
+
| `create_a_new_list` | ✅ | ❌ | |
|
|
97
|
+
| `get_a_single_list` | ✅ | ❌ | |
|
|
98
|
+
| `delete_a_list` | ✅ | ❌ | |
|
|
99
|
+
| `update_a_list` | ❌ | ❌ | |
|
|
100
|
+
| `get_a_bookmarks_in_a_list` | ❌ | ❌ | |
|
|
101
|
+
| `add_a_bookmark_to_a_list` | ❌ | ❌ | |
|
|
102
|
+
| `remove_a_bookmark_from_a_list` | ❌ | ❌ | |
|
|
103
|
+
| `get_all_tags` | ✅ | ✅ | |
|
|
104
|
+
| `get_a_single_tag` | ✅ | ❌ | |
|
|
105
|
+
| `delete_a_tag` | ✅ | ❌ | |
|
|
106
|
+
| `update_a_tag` | ✅ | ❌ | No output validation due to [server bug](https://github.com/karakeep-app/karakeep/issues/1365). |
|
|
107
|
+
| `get_a_bookmarks_with_the_tag` | ❌ | ❌ | |
|
|
108
|
+
| `get_all_highlights` | ✅ | ✅ | Tested with pagination. |
|
|
109
|
+
| `create_a_new_highlight` | ❌ | ❌ | |
|
|
110
|
+
| `get_a_single_highlight` | ❌ | ❌ | |
|
|
111
|
+
| `delete_a_highlight` | ❌ | ❌ | Works from the CLI; not yet added to Pytest. |
|
|
112
|
+
| `update_a_highlight` | ❌ | ❌ | |
|
|
113
|
+
| `get_current_user_info` | ✅ | ❌ | Pytest: Tested indirectly during client init. CLI not directly tested. |
|
|
114
|
+
| `get_current_user_stats` | ✅ | ✅ | |
|
|
112
115
|
|
|
113
116
|
## Installation
|
|
114
117
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
karakeep_python_api/__init__.py,sha256=qk3MeIIvnCNAyYzJrv8dMKVXvA4ejLU3mhB3xFzdLDY,606
|
|
2
|
+
karakeep_python_api/__main__.py,sha256=LexPUYF4zfVXY4UX8-LOxNWaI_KkQx4-a1S5zDn_UkM,24040
|
|
3
|
+
karakeep_python_api/datatypes.py,sha256=nVuaFB-BaNcTdzNqLvHBG0OlgoXdi0NxL0Rr_jqOPao,4189
|
|
4
|
+
karakeep_python_api/karakeep_api.py,sha256=uN_hUWEEXuYKKyT4Rf9tcpBSqF6Hm0cv5kmXIEotHyQ,72801
|
|
5
|
+
karakeep_python_api/openapi_reference.json,sha256=SqhEHE526dmsw07b3YkRkfhiyO6-BjCvFHpR5-l6dyU,77103
|
|
6
|
+
karakeep_python_api-0.1.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
+
karakeep_python_api-0.1.4.dist-info/METADATA,sha256=GMHME9_FPup9YQ6RFa70zoDRNQ-BThQ5RTxNEBEOL4Q,12211
|
|
8
|
+
karakeep_python_api-0.1.4.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
9
|
+
karakeep_python_api-0.1.4.dist-info/entry_points.txt,sha256=n0leQp_IX2NivoWuUcaR9ZHwAvl_6yt-NcHWuCJyxNo,62
|
|
10
|
+
karakeep_python_api-0.1.4.dist-info/top_level.txt,sha256=X3VKqh9YAbPQp144db0Ko2C5Q2y6-nwpPgtnuCiSDmU,20
|
|
11
|
+
karakeep_python_api-0.1.4.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=IJt6EUV5Owh1yO74WZsRs6lqbpOqZGuDfYHLc8azBXk,72856
|
|
5
|
-
karakeep_python_api/openapi_reference.json,sha256=2sQRiQs8xwNFmsksqWGmqnsUMr8vqhHag9GNZDmnVUk,77104
|
|
6
|
-
karakeep_python_api-0.1.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
-
karakeep_python_api-0.1.2.dist-info/METADATA,sha256=Ps-oGM6QWZCXGRS7-_EYIYcQ9OJwM4nCxCRIPW06IOk,11992
|
|
8
|
-
karakeep_python_api-0.1.2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
|
9
|
-
karakeep_python_api-0.1.2.dist-info/entry_points.txt,sha256=n0leQp_IX2NivoWuUcaR9ZHwAvl_6yt-NcHWuCJyxNo,62
|
|
10
|
-
karakeep_python_api-0.1.2.dist-info/top_level.txt,sha256=X3VKqh9YAbPQp144db0Ko2C5Q2y6-nwpPgtnuCiSDmU,20
|
|
11
|
-
karakeep_python_api-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
{karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{karakeep_python_api-0.1.2.dist-info → karakeep_python_api-0.1.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|