notionary 0.1.3__tar.gz → 0.1.5__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 (54) hide show
  1. {notionary-0.1.3 → notionary-0.1.5}/PKG-INFO +1 -1
  2. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/notion_database_schema.py +4 -2
  3. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/notion_client.py +3 -0
  4. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/page/notion_page_manager.py +19 -0
  5. {notionary-0.1.3 → notionary-0.1.5}/notionary.egg-info/PKG-INFO +1 -1
  6. {notionary-0.1.3 → notionary-0.1.5}/notionary.egg-info/SOURCES.txt +0 -3
  7. {notionary-0.1.3 → notionary-0.1.5}/setup.py +1 -1
  8. notionary-0.1.3/notionary/core/__init__.py +0 -0
  9. notionary-0.1.3/notionary/core/converters/elements/__init__.py +0 -0
  10. notionary-0.1.3/notionary/core/converters/registry/__init__.py +0 -0
  11. {notionary-0.1.3 → notionary-0.1.5}/LICENSE +0 -0
  12. {notionary-0.1.3 → notionary-0.1.5}/README.md +0 -0
  13. {notionary-0.1.3 → notionary-0.1.5}/notionary/__init__.py +0 -0
  14. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/__init__.py +0 -0
  15. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/bookmark_element.py +0 -0
  16. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/callout_element.py +0 -0
  17. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/code_block_element.py +0 -0
  18. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/column_element.py +0 -0
  19. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/divider_element.py +0 -0
  20. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/heading_element.py +0 -0
  21. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/image_element.py +0 -0
  22. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/list_element.py +0 -0
  23. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/notion_block_element.py +0 -0
  24. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/paragraph_element.py +0 -0
  25. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/qoute_element.py +0 -0
  26. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/table_element.py +0 -0
  27. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/text_inline_formatter.py +0 -0
  28. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/todo_lists.py +0 -0
  29. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/toggle_element.py +0 -0
  30. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/elements/video_element.py +0 -0
  31. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/markdown_to_notion_converter.py +0 -0
  32. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/notion_to_markdown_converter.py +0 -0
  33. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/registry/block_element_registry.py +0 -0
  34. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/converters/registry/block_element_registry_builder.py +0 -0
  35. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/database_info_service.py +0 -0
  36. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/database_query_service.py +0 -0
  37. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/database_schema_service.py +0 -0
  38. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/models/page_result.py +0 -0
  39. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/notion_database_manager.py +0 -0
  40. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/notion_database_manager_factory.py +0 -0
  41. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/notion_database_writer.py +0 -0
  42. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/database/page_service.py +0 -0
  43. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/page/meta_data/metadata_editor.py +0 -0
  44. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/page/page_content_manager.py +0 -0
  45. {notionary-0.1.3 → notionary-0.1.5}/notionary/core/page/property_formatter.py +0 -0
  46. {notionary-0.1.3 → notionary-0.1.5}/notionary/exceptions/database_exceptions.py +0 -0
  47. {notionary-0.1.3 → notionary-0.1.5}/notionary/exceptions/page_creation_exception.py +0 -0
  48. {notionary-0.1.3 → notionary-0.1.5}/notionary/util/logging_mixin.py +0 -0
  49. {notionary-0.1.3 → notionary-0.1.5}/notionary/util/singleton_decorator.py +0 -0
  50. {notionary-0.1.3 → notionary-0.1.5}/notionary/util/uuid_utils.py +0 -0
  51. {notionary-0.1.3 → notionary-0.1.5}/notionary.egg-info/dependency_links.txt +0 -0
  52. {notionary-0.1.3 → notionary-0.1.5}/notionary.egg-info/requires.txt +0 -0
  53. {notionary-0.1.3 → notionary-0.1.5}/notionary.egg-info/top_level.txt +0 -0
  54. {notionary-0.1.3 → notionary-0.1.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notionary
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A toolkit to convert between Markdown and Notion blocks
5
5
  Home-page: https://github.com/mathisarends/notionary
6
6
  Author: Mathis Arends
@@ -379,10 +379,12 @@ class NotionDatabaseSchema:
379
379
  return
380
380
 
381
381
  for page in result["results"]:
382
- page_id = page.get("id", "")
382
+ page_id: str = page.get("id", "")
383
383
  title = self._extract_page_title(page)
384
+
385
+ page_url = f"https://notion.so/{page_id.replace('-', '')}"
384
386
 
385
- notion_page_manager = NotionPageManager(page_id=page_id, title=title)
387
+ notion_page_manager = NotionPageManager(page_id=page_id, title=title, url=page_url)
386
388
  yield notion_page_manager
387
389
 
388
390
  has_more = result.get("has_more", False)
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notionary
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A toolkit to convert between Markdown and Notion blocks
5
5
  Home-page: https://github.com/mathisarends/notionary
6
6
  Author: Mathis Arends
@@ -7,12 +7,10 @@ notionary.egg-info/SOURCES.txt
7
7
  notionary.egg-info/dependency_links.txt
8
8
  notionary.egg-info/requires.txt
9
9
  notionary.egg-info/top_level.txt
10
- notionary/core/__init__.py
11
10
  notionary/core/notion_client.py
12
11
  notionary/core/converters/__init__.py
13
12
  notionary/core/converters/markdown_to_notion_converter.py
14
13
  notionary/core/converters/notion_to_markdown_converter.py
15
- notionary/core/converters/elements/__init__.py
16
14
  notionary/core/converters/elements/bookmark_element.py
17
15
  notionary/core/converters/elements/callout_element.py
18
16
  notionary/core/converters/elements/code_block_element.py
@@ -29,7 +27,6 @@ notionary/core/converters/elements/text_inline_formatter.py
29
27
  notionary/core/converters/elements/todo_lists.py
30
28
  notionary/core/converters/elements/toggle_element.py
31
29
  notionary/core/converters/elements/video_element.py
32
- notionary/core/converters/registry/__init__.py
33
30
  notionary/core/converters/registry/block_element_registry.py
34
31
  notionary/core/converters/registry/block_element_registry_builder.py
35
32
  notionary/core/database/database_info_service.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name="notionary",
5
- version="0.1.3",
5
+ version="0.1.5",
6
6
  packages=find_namespace_packages(include=["notionary*"]),
7
7
  install_requires=[
8
8
  "notion-client>=2.0.0",
File without changes
File without changes
File without changes
File without changes