karakeep-python-api 1.5.0__tar.gz → 1.7.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 (18) hide show
  1. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/LICENSE +67 -80
  2. {karakeep_python_api-1.5.0/karakeep_python_api.egg-info → karakeep_python_api-1.7.0}/PKG-INFO +2 -10
  3. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/README.md +1 -6
  4. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api/datatypes.py +8 -0
  5. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api/karakeep_api.py +58 -8
  6. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api/openapi_reference.json +84 -0
  7. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0/karakeep_python_api.egg-info}/PKG-INFO +2 -10
  8. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/setup.py +1 -3
  9. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/MANIFEST.in +0 -0
  10. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api/__init__.py +0 -0
  11. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api/__main__.py +0 -0
  12. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api.egg-info/SOURCES.txt +0 -0
  13. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api.egg-info/dependency_links.txt +0 -0
  14. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api.egg-info/entry_points.txt +0 -0
  15. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api.egg-info/requires.txt +0 -0
  16. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/karakeep_python_api.egg-info/top_level.txt +0 -0
  17. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/setup.cfg +0 -0
  18. {karakeep_python_api-1.5.0 → karakeep_python_api-1.7.0}/tests/test_karakeep_api.py +0 -0
@@ -1,5 +1,5 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
3
 
4
4
  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
5
  Everyone is permitted to copy and distribute verbatim copies
@@ -7,17 +7,15 @@
7
7
 
8
8
  Preamble
9
9
 
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
12
13
 
13
14
  The licenses for most software and other practical works are designed
14
15
  to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
+ our General Public Licenses are intended to guarantee your freedom to
16
17
  share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
18
+ software for all its users.
21
19
 
22
20
  When we speak of free software, we are referring to freedom, not
23
21
  price. Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
26
24
  want it, that you can change the software or use pieces of it in new
27
25
  free programs, and that you know you can do these things.
28
26
 
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
67
55
 
68
56
  The precise terms and conditions for copying, distribution and
69
57
  modification follow.
@@ -72,7 +60,7 @@ modification follow.
72
60
 
73
61
  0. Definitions.
74
62
 
75
- "This License" refers to version 3 of the GNU General Public License.
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
76
64
 
77
65
  "Copyright" also means copyright-like laws that apply to other kinds of
78
66
  works, such as semiconductor masks.
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
549
537
  the Program, the only way you could satisfy both those terms and this
550
538
  License would be to refrain entirely from conveying the Program.
551
539
 
552
- 13. Use with the GNU Affero General Public License.
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
553
552
 
554
553
  Notwithstanding any other provision of this License, you have
555
554
  permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
555
+ under version 3 of the GNU General Public License into a single
557
556
  combined work, and to convey the resulting work. The terms of this
558
557
  License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
562
560
 
563
561
  14. Revised Versions of this License.
564
562
 
565
563
  The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
568
566
  address new problems or concerns.
569
567
 
570
568
  Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
569
+ Program specifies that a certain numbered version of the GNU Affero General
572
570
  Public License "or any later version" applies to it, you have the
573
571
  option of following the terms and conditions either of that numbered
574
572
  version or of any later version published by the Free Software
575
573
  Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
574
+ GNU Affero General Public License, you may choose any version ever published
577
575
  by the Free Software Foundation.
578
576
 
579
577
  If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
578
+ versions of the GNU Affero General Public License can be used, that proxy's
581
579
  public statement of acceptance of a version permanently authorizes you
582
580
  to choose that version for the Program.
583
581
 
@@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
635
633
  Copyright (C) <year> <name of author>
636
634
 
637
635
  This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
636
+ it under the terms of the GNU Affero General Public License as published by
639
637
  the Free Software Foundation, either version 3 of the License, or
640
638
  (at your option) any later version.
641
639
 
642
640
  This program is distributed in the hope that it will be useful,
643
641
  but WITHOUT ANY WARRANTY; without even the implied warranty of
644
642
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
643
+ GNU Affero General Public License for more details.
646
644
 
647
- You should have received a copy of the GNU General Public License
645
+ You should have received a copy of the GNU Affero General Public License
648
646
  along with this program. If not, see <https://www.gnu.org/licenses/>.
649
647
 
650
648
  Also add information on how to contact you by electronic and paper mail.
651
649
 
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
663
657
 
664
658
  You should also get your employer (if you work as a programmer) or school,
665
659
  if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
667
661
  <https://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <https://www.gnu.org/licenses/why-not-lgpl.html>.
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karakeep_python_api
3
- Version: 1.5.0
3
+ Version: 1.7.0
4
4
  Summary: Community python client for the Karakeep API.
5
5
  Home-page: https://github.com/thiswillbeyourgithub/karakeep_python_api/
6
- License: GPLv3
7
6
  Keywords: rss,karakeep,hoarder,data-hoarding,python,api,feeds,openapi
8
7
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
8
  Classifier: Operating System :: OS Independent
11
9
  Requires-Python: >=3.9
12
10
  Description-Content-Type: text/markdown
@@ -26,7 +24,6 @@ Dynamic: description
26
24
  Dynamic: description-content-type
27
25
  Dynamic: home-page
28
26
  Dynamic: keywords
29
- Dynamic: license
30
27
  Dynamic: license-file
31
28
  Dynamic: provides-extra
32
29
  Dynamic: requires-dist
@@ -35,7 +32,6 @@ Dynamic: summary
35
32
 
36
33
  # Karakeep Python API Client
37
34
 
38
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
39
35
  [![PyPI version](https://badge.fury.io/py/karakeep-python-api.svg)](https://badge.fury.io/py/karakeep-python-api)
40
36
 
41
37
  A community-developed Python client for the [Karakeep](https://karakeep.app/) API.
@@ -54,7 +50,6 @@ A community-developed Python client for the [Karakeep](https://karakeep.app/) AP
54
50
  - [Python Library](#python-library)
55
51
  - [Community Scripts](#community-scripts)
56
52
  - [Development](#development)
57
- - [License](#license)
58
53
 
59
54
  ## Overview
60
55
 
@@ -70,7 +65,7 @@ The development process involved:
70
65
 
71
66
  * **Experimental Methods:** The included Pytest suite currently only covers a subset of the available API methods (primarily 'get all' endpoints and client initialization). Methods *not* explicitly tested should be considered **experimental**.
72
67
  * **Ongoing Development:** The author intends to improve and validate methods as they are needed for personal use cases. Contributions and bug reports are welcome!
73
- * **Updating process**: I have local scripts to keep track of the changes in the OpenAPI specs on the server side. From time to time I go and use aider to make the code reflect the latest openapi and push that to the `dev` branch. When there is a new karakeep release, I will merge the `dev` branch to the `main` branch and create my own release. This way, `dev` hopefully is up to date with the latest code of karakeep, while `main` is up to date with the latest release of karakeep.
68
+ * **Updating process**: I have local scripts that downloads the latest OpenAPI specs from karakeep's repo. I then visually inspect the diff, stage a few changes into git, then run `aider --read karakeep_python_api/openapi_reference.json karakeep_python_api/karakeep_api.py karakeep_python_api/datatypes.py --message "As you can see from the git diff output, there was a small update to the openapi reference json file. Please update the python code to match this new update. Here is the git output: $(git --no-pager diff --staged) "`.
74
69
 
75
70
  ## API Method Coverage
76
71
 
@@ -283,9 +278,6 @@ They can be found in the [./community_scripts](https://github.com/thiswillbeyour
283
278
  pytest
284
279
  ```
285
280
 
286
- ## License
287
-
288
- This project is licensed under the **GNU General Public License v3 (GPLv3)**. See the [LICENSE](LICENSE) file for details.
289
281
 
290
282
  ---
291
283
 
@@ -1,6 +1,5 @@
1
1
  # Karakeep Python API Client
2
2
 
3
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
4
3
  [![PyPI version](https://badge.fury.io/py/karakeep-python-api.svg)](https://badge.fury.io/py/karakeep-python-api)
5
4
 
6
5
  A community-developed Python client for the [Karakeep](https://karakeep.app/) API.
@@ -19,7 +18,6 @@ A community-developed Python client for the [Karakeep](https://karakeep.app/) AP
19
18
  - [Python Library](#python-library)
20
19
  - [Community Scripts](#community-scripts)
21
20
  - [Development](#development)
22
- - [License](#license)
23
21
 
24
22
  ## Overview
25
23
 
@@ -35,7 +33,7 @@ The development process involved:
35
33
 
36
34
  * **Experimental Methods:** The included Pytest suite currently only covers a subset of the available API methods (primarily 'get all' endpoints and client initialization). Methods *not* explicitly tested should be considered **experimental**.
37
35
  * **Ongoing Development:** The author intends to improve and validate methods as they are needed for personal use cases. Contributions and bug reports are welcome!
38
- * **Updating process**: I have local scripts to keep track of the changes in the OpenAPI specs on the server side. From time to time I go and use aider to make the code reflect the latest openapi and push that to the `dev` branch. When there is a new karakeep release, I will merge the `dev` branch to the `main` branch and create my own release. This way, `dev` hopefully is up to date with the latest code of karakeep, while `main` is up to date with the latest release of karakeep.
36
+ * **Updating process**: I have local scripts that downloads the latest OpenAPI specs from karakeep's repo. I then visually inspect the diff, stage a few changes into git, then run `aider --read karakeep_python_api/openapi_reference.json karakeep_python_api/karakeep_api.py karakeep_python_api/datatypes.py --message "As you can see from the git diff output, there was a small update to the openapi reference json file. Please update the python code to match this new update. Here is the git output: $(git --no-pager diff --staged) "`.
39
37
 
40
38
  ## API Method Coverage
41
39
 
@@ -248,9 +246,6 @@ They can be found in the [./community_scripts](https://github.com/thiswillbeyour
248
246
  pytest
249
247
  ```
250
248
 
251
- ## License
252
-
253
- This project is licensed under the **GNU General Public License v3 (GPLv3)**. See the [LICENSE](LICENSE) file for details.
254
249
 
255
250
  ---
256
251
 
@@ -46,6 +46,7 @@ class ContentTypeLink(BaseModel):
46
46
  imageUrl: Optional[str] = None
47
47
  imageAssetId: Optional[str] = None
48
48
  screenshotAssetId: Optional[str] = None
49
+ pdfAssetId: Optional[str] = None
49
50
  fullPageArchiveAssetId: Optional[str] = None
50
51
  precrawledArchiveAssetId: Optional[str] = None
51
52
  videoAssetId: Optional[str] = None
@@ -53,6 +54,7 @@ class ContentTypeLink(BaseModel):
53
54
  htmlContent: Optional[str] = None
54
55
  contentAssetId: Optional[str] = None
55
56
  crawledAt: Optional[str] = None
57
+ crawlStatus: Optional[Literal["success", "failure", "pending"]] = None
56
58
  author: Optional[str] = None
57
59
  publisher: Optional[str] = None
58
60
  datePublished: Optional[str] = None
@@ -84,6 +86,7 @@ class BookmarkAsset(BaseModel):
84
86
  assetType: Literal[
85
87
  "linkHtmlContent",
86
88
  "screenshot",
89
+ "pdf",
87
90
  "assetScreenshot",
88
91
  "bannerImage",
89
92
  "fullPageArchive",
@@ -91,6 +94,7 @@ class BookmarkAsset(BaseModel):
91
94
  "bookmarkAsset",
92
95
  "precrawledArchive",
93
96
  "userUploaded",
97
+ "avatar",
94
98
  "unknown",
95
99
  ]
96
100
  fileName: Optional[str] = None
@@ -132,6 +136,10 @@ class PaginatedBookmarks(BaseModel):
132
136
  nextCursor: Optional[str] = ""
133
137
 
134
138
 
139
+ class CheckUrlResponse(BaseModel):
140
+ bookmarkId: Optional[str]
141
+
142
+
135
143
  class ListModel(BaseModel):
136
144
  id: str
137
145
  name: str
@@ -85,7 +85,7 @@ class KarakeepAPI:
85
85
  """
86
86
 
87
87
  # Version reflects the client library version, updated by bumpver
88
- VERSION: str = "1.5.0"
88
+ VERSION: str = "1.7.0"
89
89
 
90
90
  def __init__(
91
91
  self,
@@ -930,6 +930,38 @@ class KarakeepAPI:
930
930
  # Response should match PaginatedBookmarks schema
931
931
  return datatypes.PaginatedBookmarks.model_validate(response_data)
932
932
 
933
+ @optional_typecheck
934
+ def check_url(
935
+ self,
936
+ url: str,
937
+ ) -> Union[datatypes.CheckUrlResponse, Dict[str, Any], List[Any]]:
938
+ """
939
+ Check if a URL is already bookmarked. Corresponds to GET /bookmarks/check-url.
940
+ Uses substring matching to find candidates, then normalizes URLs (ignoring hash fragments and trailing slashes) for exact comparison.
941
+
942
+ Args:
943
+ url: The URL to check.
944
+
945
+ Returns:
946
+ datatypes.CheckUrlResponse: Object indicating whether the URL is bookmarked. bookmarkId is null if not found.
947
+ If response validation is disabled, returns the raw API response (dict/list).
948
+
949
+ Raises:
950
+ APIError: If the API request fails.
951
+ pydantic.ValidationError: If response validation fails (and is not disabled).
952
+ """
953
+ params = {
954
+ "url": url,
955
+ }
956
+ response_data = self._call("GET", "bookmarks/check-url", params=params)
957
+
958
+ if self.disable_response_validation:
959
+ logger.debug("Skipping response validation as requested.")
960
+ return response_data
961
+ else:
962
+ # Response should match CheckUrlResponse schema
963
+ return datatypes.CheckUrlResponse.model_validate(response_data)
964
+
933
965
  @optional_typecheck
934
966
  def get_a_single_bookmark(
935
967
  self,
@@ -1048,6 +1080,7 @@ class KarakeepAPI:
1048
1080
  bookmark_id: str,
1049
1081
  tag_ids: Optional[List[str]] = None,
1050
1082
  tag_names: Optional[List[str]] = None,
1083
+ attached_by: Optional[Literal["ai", "human"]] = "human",
1051
1084
  ) -> Dict[str, Any]:
1052
1085
  """
1053
1086
  Attach one or more tags to a bookmark. Corresponds to POST /bookmarks/{bookmarkId}/tags.
@@ -1056,6 +1089,7 @@ class KarakeepAPI:
1056
1089
  bookmark_id: The ID (string) of the bookmark.
1057
1090
  tag_ids: List of existing tag IDs to attach (optional).
1058
1091
  tag_names: List of tag names to attach (will create tags if they don't exist) (optional).
1092
+ attached_by: Who attached the tag, either "ai" or "human" (default: "human").
1059
1093
 
1060
1094
  Returns:
1061
1095
  dict: A dictionary containing the list of attached tag IDs under the key "attached".
@@ -1097,11 +1131,17 @@ class KarakeepAPI:
1097
1131
 
1098
1132
  if tag_ids:
1099
1133
  for tag_id in tag_ids:
1100
- tags_list.append({"tagId": tag_id.strip()})
1134
+ tag_entry: Dict[str, Any] = {"tagId": tag_id.strip()}
1135
+ if attached_by is not None:
1136
+ tag_entry["attachedBy"] = attached_by
1137
+ tags_list.append(tag_entry)
1101
1138
 
1102
1139
  if tag_names:
1103
1140
  for tag_name in tag_names:
1104
- tags_list.append({"tagName": tag_name.strip()})
1141
+ tag_entry = {"tagName": tag_name.strip()}
1142
+ if attached_by is not None:
1143
+ tag_entry["attachedBy"] = attached_by
1144
+ tags_list.append(tag_entry)
1105
1145
 
1106
1146
  tags_data = {"tags": tags_list}
1107
1147
 
@@ -1123,6 +1163,7 @@ class KarakeepAPI:
1123
1163
  bookmark_id: str,
1124
1164
  tag_ids: Optional[List[str]] = None,
1125
1165
  tag_names: Optional[List[str]] = None,
1166
+ attached_by: Optional[Literal["ai", "human"]] = "human",
1126
1167
  ) -> Dict[str, Any]:
1127
1168
  """
1128
1169
  Detach one or more tags from a bookmark. Corresponds to DELETE /bookmarks/{bookmarkId}/tags.
@@ -1131,6 +1172,7 @@ class KarakeepAPI:
1131
1172
  bookmark_id: The ID (string) of the bookmark.
1132
1173
  tag_ids: List of existing tag IDs to detach (optional).
1133
1174
  tag_names: List of tag names to detach (optional).
1175
+ attached_by: Who attached the tag, either "ai" or "human" (default: "human").
1134
1176
 
1135
1177
  Returns:
1136
1178
  dict: A dictionary containing the list of detached tag IDs under the key "detached".
@@ -1172,11 +1214,17 @@ class KarakeepAPI:
1172
1214
 
1173
1215
  if tag_ids:
1174
1216
  for tag_id in tag_ids:
1175
- tags_list.append({"tagId": tag_id.strip()})
1217
+ tag_entry: Dict[str, Any] = {"tagId": tag_id.strip()}
1218
+ if attached_by is not None:
1219
+ tag_entry["attachedBy"] = attached_by
1220
+ tags_list.append(tag_entry)
1176
1221
 
1177
1222
  if tag_names:
1178
1223
  for tag_name in tag_names:
1179
- tags_list.append({"tagName": tag_name.strip()})
1224
+ tag_entry = {"tagName": tag_name.strip()}
1225
+ if attached_by is not None:
1226
+ tag_entry["attachedBy"] = attached_by
1227
+ tags_list.append(tag_entry)
1180
1228
 
1181
1229
  tags_data = {"tags": tags_list}
1182
1230
 
@@ -1295,6 +1343,7 @@ class KarakeepAPI:
1295
1343
  asset_id: str,
1296
1344
  asset_type: Literal[
1297
1345
  "screenshot",
1346
+ "pdf",
1298
1347
  "assetScreenshot",
1299
1348
  "bannerImage",
1300
1349
  "fullPageArchive",
@@ -1302,6 +1351,7 @@ class KarakeepAPI:
1302
1351
  "bookmarkAsset",
1303
1352
  "precrawledArchive",
1304
1353
  "userUploaded",
1354
+ "avatar",
1305
1355
  "unknown",
1306
1356
  ],
1307
1357
  ) -> Union[datatypes.BookmarkAsset, Dict[str, Any], List[Any]]:
@@ -1311,9 +1361,9 @@ class KarakeepAPI:
1311
1361
  Args:
1312
1362
  bookmark_id: The ID (string) of the bookmark.
1313
1363
  asset_id: The ID (string) of the asset to attach.
1314
- asset_type: The type of asset being attached. Must be one of: "screenshot", "assetScreenshot",
1364
+ asset_type: The type of asset being attached. Must be one of: "screenshot", "pdf", "assetScreenshot",
1315
1365
  "bannerImage", "fullPageArchive", "video", "bookmarkAsset", "precrawledArchive",
1316
- "userUploaded", "unknown".
1366
+ "userUploaded", "avatar", "unknown".
1317
1367
 
1318
1368
  Returns:
1319
1369
  datatypes.BookmarkAsset: The attached asset object.
@@ -2044,7 +2094,7 @@ class KarakeepAPI:
2044
2094
  Get information about the current authenticated user. Corresponds to GET /users/me.
2045
2095
 
2046
2096
  Returns:
2047
- dict: A dictionary containing user information ('id', 'name', 'email', 'localUser').
2097
+ dict: A dictionary containing user information ('id', 'name', 'email', 'image', 'localUser').
2048
2098
  Validation is not performed on this response type by default.
2049
2099
 
2050
2100
  Raises:
@@ -175,6 +175,10 @@
175
175
  "type": "string",
176
176
  "nullable": true
177
177
  },
178
+ "pdfAssetId": {
179
+ "type": "string",
180
+ "nullable": true
181
+ },
178
182
  "fullPageArchiveAssetId": {
179
183
  "type": "string",
180
184
  "nullable": true
@@ -203,6 +207,15 @@
203
207
  "type": "string",
204
208
  "nullable": true
205
209
  },
210
+ "crawlStatus": {
211
+ "type": "string",
212
+ "nullable": true,
213
+ "enum": [
214
+ "success",
215
+ "failure",
216
+ "pending"
217
+ ]
218
+ },
206
219
  "author": {
207
220
  "type": "string",
208
221
  "nullable": true
@@ -318,6 +331,7 @@
318
331
  "enum": [
319
332
  "linkHtmlContent",
320
333
  "screenshot",
334
+ "pdf",
321
335
  "assetScreenshot",
322
336
  "bannerImage",
323
337
  "fullPageArchive",
@@ -325,6 +339,7 @@
325
339
  "bookmarkAsset",
326
340
  "precrawledArchive",
327
341
  "userUploaded",
342
+ "avatar",
328
343
  "unknown"
329
344
  ]
330
345
  },
@@ -968,6 +983,51 @@
968
983
  }
969
984
  }
970
985
  },
986
+ "/bookmarks/check-url": {
987
+ "get": {
988
+ "description": "Check if a URL is already bookmarked. Uses substring matching to find candidates, then normalizes URLs (ignoring hash fragments and trailing slashes) for exact comparison.",
989
+ "summary": "Check if a URL exists in bookmarks",
990
+ "tags": [
991
+ "Bookmarks"
992
+ ],
993
+ "security": [
994
+ {
995
+ "bearerAuth": []
996
+ }
997
+ ],
998
+ "parameters": [
999
+ {
1000
+ "schema": {
1001
+ "type": "string"
1002
+ },
1003
+ "required": true,
1004
+ "name": "url",
1005
+ "in": "query"
1006
+ }
1007
+ ],
1008
+ "responses": {
1009
+ "200": {
1010
+ "description": "Object indicating whether the URL is bookmarked. bookmarkId is null if not found.",
1011
+ "content": {
1012
+ "application/json": {
1013
+ "schema": {
1014
+ "type": "object",
1015
+ "properties": {
1016
+ "bookmarkId": {
1017
+ "type": "string",
1018
+ "nullable": true
1019
+ }
1020
+ },
1021
+ "required": [
1022
+ "bookmarkId"
1023
+ ]
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ },
971
1031
  "/bookmarks/{bookmarkId}": {
972
1032
  "get": {
973
1033
  "description": "Get bookmark by its id",
@@ -1430,6 +1490,14 @@
1430
1490
  },
1431
1491
  "tagName": {
1432
1492
  "type": "string"
1493
+ },
1494
+ "attachedBy": {
1495
+ "type": "string",
1496
+ "enum": [
1497
+ "ai",
1498
+ "human"
1499
+ ],
1500
+ "default": "human"
1433
1501
  }
1434
1502
  }
1435
1503
  }
@@ -1521,6 +1589,14 @@
1521
1589
  },
1522
1590
  "tagName": {
1523
1591
  "type": "string"
1592
+ },
1593
+ "attachedBy": {
1594
+ "type": "string",
1595
+ "enum": [
1596
+ "ai",
1597
+ "human"
1598
+ ],
1599
+ "default": "human"
1524
1600
  }
1525
1601
  }
1526
1602
  }
@@ -1740,6 +1816,7 @@
1740
1816
  "enum": [
1741
1817
  "linkHtmlContent",
1742
1818
  "screenshot",
1819
+ "pdf",
1743
1820
  "assetScreenshot",
1744
1821
  "bannerImage",
1745
1822
  "fullPageArchive",
@@ -1747,6 +1824,7 @@
1747
1824
  "bookmarkAsset",
1748
1825
  "precrawledArchive",
1749
1826
  "userUploaded",
1827
+ "avatar",
1750
1828
  "unknown"
1751
1829
  ]
1752
1830
  }
@@ -1775,6 +1853,7 @@
1775
1853
  "enum": [
1776
1854
  "linkHtmlContent",
1777
1855
  "screenshot",
1856
+ "pdf",
1778
1857
  "assetScreenshot",
1779
1858
  "bannerImage",
1780
1859
  "fullPageArchive",
@@ -1782,6 +1861,7 @@
1782
1861
  "bookmarkAsset",
1783
1862
  "precrawledArchive",
1784
1863
  "userUploaded",
1864
+ "avatar",
1785
1865
  "unknown"
1786
1866
  ]
1787
1867
  },
@@ -3248,6 +3328,10 @@
3248
3328
  "type": "string",
3249
3329
  "nullable": true
3250
3330
  },
3331
+ "image": {
3332
+ "type": "string",
3333
+ "nullable": true
3334
+ },
3251
3335
  "localUser": {
3252
3336
  "type": "boolean"
3253
3337
  }
@@ -1,12 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karakeep_python_api
3
- Version: 1.5.0
3
+ Version: 1.7.0
4
4
  Summary: Community python client for the Karakeep API.
5
5
  Home-page: https://github.com/thiswillbeyourgithub/karakeep_python_api/
6
- License: GPLv3
7
6
  Keywords: rss,karakeep,hoarder,data-hoarding,python,api,feeds,openapi
8
7
  Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
8
  Classifier: Operating System :: OS Independent
11
9
  Requires-Python: >=3.9
12
10
  Description-Content-Type: text/markdown
@@ -26,7 +24,6 @@ Dynamic: description
26
24
  Dynamic: description-content-type
27
25
  Dynamic: home-page
28
26
  Dynamic: keywords
29
- Dynamic: license
30
27
  Dynamic: license-file
31
28
  Dynamic: provides-extra
32
29
  Dynamic: requires-dist
@@ -35,7 +32,6 @@ Dynamic: summary
35
32
 
36
33
  # Karakeep Python API Client
37
34
 
38
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
39
35
  [![PyPI version](https://badge.fury.io/py/karakeep-python-api.svg)](https://badge.fury.io/py/karakeep-python-api)
40
36
 
41
37
  A community-developed Python client for the [Karakeep](https://karakeep.app/) API.
@@ -54,7 +50,6 @@ A community-developed Python client for the [Karakeep](https://karakeep.app/) AP
54
50
  - [Python Library](#python-library)
55
51
  - [Community Scripts](#community-scripts)
56
52
  - [Development](#development)
57
- - [License](#license)
58
53
 
59
54
  ## Overview
60
55
 
@@ -70,7 +65,7 @@ The development process involved:
70
65
 
71
66
  * **Experimental Methods:** The included Pytest suite currently only covers a subset of the available API methods (primarily 'get all' endpoints and client initialization). Methods *not* explicitly tested should be considered **experimental**.
72
67
  * **Ongoing Development:** The author intends to improve and validate methods as they are needed for personal use cases. Contributions and bug reports are welcome!
73
- * **Updating process**: I have local scripts to keep track of the changes in the OpenAPI specs on the server side. From time to time I go and use aider to make the code reflect the latest openapi and push that to the `dev` branch. When there is a new karakeep release, I will merge the `dev` branch to the `main` branch and create my own release. This way, `dev` hopefully is up to date with the latest code of karakeep, while `main` is up to date with the latest release of karakeep.
68
+ * **Updating process**: I have local scripts that downloads the latest OpenAPI specs from karakeep's repo. I then visually inspect the diff, stage a few changes into git, then run `aider --read karakeep_python_api/openapi_reference.json karakeep_python_api/karakeep_api.py karakeep_python_api/datatypes.py --message "As you can see from the git diff output, there was a small update to the openapi reference json file. Please update the python code to match this new update. Here is the git output: $(git --no-pager diff --staged) "`.
74
69
 
75
70
  ## API Method Coverage
76
71
 
@@ -283,9 +278,6 @@ They can be found in the [./community_scripts](https://github.com/thiswillbeyour
283
278
  pytest
284
279
  ```
285
280
 
286
- ## License
287
-
288
- This project is licensed under the **GNU General Public License v3 (GPLv3)**. See the [LICENSE](LICENSE) file for details.
289
281
 
290
282
  ---
291
283
 
@@ -7,7 +7,7 @@ with open("README.md", "r") as readme:
7
7
 
8
8
  setup(
9
9
  name="karakeep_python_api",
10
- version="1.5.0",
10
+ version="1.7.0",
11
11
  description="Community python client for the Karakeep API.", # Simplified description
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
@@ -16,10 +16,8 @@ setup(
16
16
  include_package_data=True,
17
17
  classifiers=[
18
18
  "Programming Language :: Python :: 3",
19
- "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
20
19
  "Operating System :: OS Independent",
21
20
  ],
22
- license="GPLv3",
23
21
  keywords=[
24
22
  "rss",
25
23
  "karakeep",