notionary 0.1.3__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.
- notionary/core/notion_client.py +3 -0
- notionary/core/page/notion_page_manager.py +19 -0
- {notionary-0.1.3.dist-info → notionary-0.1.4.dist-info}/METADATA +1 -1
- {notionary-0.1.3.dist-info → notionary-0.1.4.dist-info}/RECORD +7 -10
- notionary/core/__init__.py +0 -0
- notionary/core/converters/elements/__init__.py +0 -0
- notionary/core/converters/registry/__init__.py +0 -0
- {notionary-0.1.3.dist-info → notionary-0.1.4.dist-info}/WHEEL +0 -0
- {notionary-0.1.3.dist-info → notionary-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {notionary-0.1.3.dist-info → notionary-0.1.4.dist-info}/top_level.txt +0 -0
notionary/core/notion_client.py
CHANGED
@@ -52,6 +52,9 @@ class NotionClient(LoggingMixin):
|
|
52
52
|
|
53
53
|
async def get(self, endpoint: str) -> Optional[Dict[str, Any]]:
|
54
54
|
return await self._make_request(HttpMethod.GET, endpoint)
|
55
|
+
|
56
|
+
async def get_page(self, page_id: str) -> Optional[Dict[str, Any]]:
|
57
|
+
return await self.get(f"pages/{page_id}")
|
55
58
|
|
56
59
|
async def post(
|
57
60
|
self, endpoint: str, data: Optional[Dict[str, Any]] = None
|
@@ -108,3 +108,22 @@ class NotionPageManager(LoggingMixin):
|
|
108
108
|
|
109
109
|
async def set_page_cover(self, external_url: str) -> Optional[Dict[str, Any]]:
|
110
110
|
return await self._metadata.set_cover(external_url)
|
111
|
+
|
112
|
+
async def get_properties(self) -> Dict[str, Any]:
|
113
|
+
"""Retrieves all properties of the page"""
|
114
|
+
page_data = await self._client.get_page(self._page_id)
|
115
|
+
if page_data and "properties" in page_data:
|
116
|
+
return page_data["properties"]
|
117
|
+
return {}
|
118
|
+
|
119
|
+
async def get_status(self) -> Optional[str]:
|
120
|
+
"""
|
121
|
+
Determines the status of the page (e.g., 'Draft', 'Completed', etc.)
|
122
|
+
|
123
|
+
Returns:
|
124
|
+
Optional[str]: The status as a string or None if not available
|
125
|
+
"""
|
126
|
+
properties = await self.get_properties()
|
127
|
+
if "Status" in properties and properties["Status"].get("status"):
|
128
|
+
return properties["Status"]["status"]["name"]
|
129
|
+
return None
|
@@ -1,10 +1,8 @@
|
|
1
1
|
notionary/__init__.py,sha256=5T16clJlSHFsopcPUnkGrEo8spNDUQ0i-O00UEF7nR8,320
|
2
|
-
notionary/core/
|
3
|
-
notionary/core/notion_client.py,sha256=AKxQcXkQ9OsvFBBJEvMYfXipos8ttOMf_LtT09aR41M,4646
|
2
|
+
notionary/core/notion_client.py,sha256=hZLQCAC38veUdOi2NYijxDYTpwOzXHRHDPArEbsXqLk,4776
|
4
3
|
notionary/core/converters/__init__.py,sha256=GOUehJbe4BKHtec1MqL1YGu3AX8zFtkwSZfhYkY5-P0,1798
|
5
4
|
notionary/core/converters/markdown_to_notion_converter.py,sha256=PGtg4v5lUvkXXl1Y8E6a3Mf8hEfxfhBrslPs_H_Lq_E,16564
|
6
5
|
notionary/core/converters/notion_to_markdown_converter.py,sha256=c8GyWX8-UrNfRDk7OOBKbSEb5qOwljUCwI6g5risO2c,1287
|
7
|
-
notionary/core/converters/elements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
6
|
notionary/core/converters/elements/bookmark_element.py,sha256=bpHobkGnyBGDAJK5vY9R3Ntl4GiRSF-EyyA31aq2O3E,8593
|
9
7
|
notionary/core/converters/elements/callout_element.py,sha256=rkDoXikjIl-zU3GLawSXgRunBJGLnEvin9zIlCgW4TY,5964
|
10
8
|
notionary/core/converters/elements/code_block_element.py,sha256=G1iGMsGSK5KPSk-tA8TsPs9XNU9ydjYfOVnjIvdZG74,5189
|
@@ -21,7 +19,6 @@ notionary/core/converters/elements/text_inline_formatter.py,sha256=FE_Sq2cozpu5R
|
|
21
19
|
notionary/core/converters/elements/todo_lists.py,sha256=wgY6YejURBQ5ESdVLZVIy9QKchS-x8odrmS8X4cC5Kc,4265
|
22
20
|
notionary/core/converters/elements/toggle_element.py,sha256=Xv4MuuOyoamvT3IEJX4mynvLEycgtZ9LWt6Nm764KXE,6980
|
23
21
|
notionary/core/converters/elements/video_element.py,sha256=xrBLY3e_SgKNamItZkfPNMbNEh37Ftp4jWIV6nwV-ds,6047
|
24
|
-
notionary/core/converters/registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
22
|
notionary/core/converters/registry/block_element_registry.py,sha256=0dpRFMM67UVmXRMP4-Ubc_uCZCVVmRKgxPpueCeknjw,8619
|
26
23
|
notionary/core/converters/registry/block_element_registry_builder.py,sha256=yTV1GPKAN7o65r9jHIqPeBCw0ICdaUZnRC5JKNwpRq4,9227
|
27
24
|
notionary/core/database/database_info_service.py,sha256=58k7om0UXP8w0jCJHewccG5UbOvELMBAbQvXOm7F1OM,1341
|
@@ -33,7 +30,7 @@ notionary/core/database/notion_database_schema.py,sha256=DpZPkrR15u24PGd8jhTrqng
|
|
33
30
|
notionary/core/database/notion_database_writer.py,sha256=qpKOSDLI89GWL1kDnzLKSY5GVIzQHVYAWUl12_n-nwU,13651
|
34
31
|
notionary/core/database/page_service.py,sha256=NzKCU2G-mnmqOitNWCJ6jOr0HSv1vPi1-ScSruvFdqg,5190
|
35
32
|
notionary/core/database/models/page_result.py,sha256=Vmm5_oYpYAkIIJVoTd1ZZGloeC3cmFLMYP255mAmtaw,233
|
36
|
-
notionary/core/page/notion_page_manager.py,sha256=
|
33
|
+
notionary/core/page/notion_page_manager.py,sha256=fvEomwMMOkjUBnE6QdTfrzfNsqTTuVi-7a9ehC3U29Q,4865
|
37
34
|
notionary/core/page/page_content_manager.py,sha256=wx-2bW4znIaBVZeFwtoVrmlGUwHMLBPOLkQCZDIV3sA,3180
|
38
35
|
notionary/core/page/property_formatter.py,sha256=X70Yfg0Y8HYLrFH7Y_BZVhhc_6b369jjn02bc5IZBBI,3780
|
39
36
|
notionary/core/page/meta_data/metadata_editor.py,sha256=FpB7BA5cicWmEictwdn7EuRBMX7bGvSxbdM5Grs-jLI,1347
|
@@ -42,8 +39,8 @@ notionary/exceptions/page_creation_exception.py,sha256=4v7IuZD6GsQLrqhDLriGjuG3M
|
|
42
39
|
notionary/util/logging_mixin.py,sha256=fKsx9t90bwvL74ZX3dU-sXdC4TZCQyO6qU9I8txkw_U,1369
|
43
40
|
notionary/util/singleton_decorator.py,sha256=GTNMfIlVNRUVMw_c88xqd12-DcqZJjmyidN54yqiNVw,472
|
44
41
|
notionary/util/uuid_utils.py,sha256=qS2tdJSqw_gLyQxVIqlIdmkzGa7b9bJ-vw88RiQ-oGc,680
|
45
|
-
notionary-0.1.
|
46
|
-
notionary-0.1.
|
47
|
-
notionary-0.1.
|
48
|
-
notionary-0.1.
|
49
|
-
notionary-0.1.
|
42
|
+
notionary-0.1.4.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
|
43
|
+
notionary-0.1.4.dist-info/METADATA,sha256=xcQjDgdfcTJ7T5ThHVPanYDcfYIMeNKo841a1_Ijs14,6153
|
44
|
+
notionary-0.1.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
45
|
+
notionary-0.1.4.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
|
46
|
+
notionary-0.1.4.dist-info/RECORD,,
|
notionary/core/__init__.py
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|