notionary 0.2.1__py3-none-any.whl → 0.2.3__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.
@@ -67,7 +67,7 @@ class BlockRegistryBuilder:
67
67
  .with_paragraphs()
68
68
  .with_toggleable_heading_element()
69
69
  ).build()
70
-
70
+
71
71
  @classmethod
72
72
  def create_minimal_registry(cls) -> BlockRegistry:
73
73
  """
@@ -5,12 +5,6 @@ from typing import Optional, List, Dict, Any, Literal
5
5
  from notionary.models.notion_page_response import Icon
6
6
 
7
7
 
8
- @dataclass
9
- class TextContent:
10
- content: str
11
- link: Optional[str] = None
12
-
13
-
14
8
  @dataclass
15
9
  class TextContent:
16
10
  content: str
@@ -33,12 +27,12 @@ class User:
33
27
 
34
28
  @dataclass
35
29
  class Parent:
36
- type: Literal["page_id", "workspace"]
30
+ type: Literal["page_id", "workspace", "block_id"]
37
31
  page_id: Optional[str] = None
32
+ block_id: Optional[str] = None # Added block_id field
38
33
 
39
34
 
40
- @dataclass
41
- class NotionDatabaserResponse(BaseModel):
35
+ class NotionDatabaseResponse(BaseModel):
42
36
  """
43
37
  Represents the response from the Notion API when retrieving a database.
44
38
  """
@@ -5,7 +5,7 @@ from enum import Enum
5
5
  from typing import Dict, Any, Optional, Union
6
6
  import httpx
7
7
  from dotenv import load_dotenv
8
- from notionary.models.notion_database_response import NotionDatabaserResponse
8
+ from notionary.models.notion_database_response import NotionDatabaseResponse
9
9
  from notionary.models.notion_page_response import NotionPageResponse
10
10
  from notionary.util.logging_mixin import LoggingMixin
11
11
 
@@ -69,9 +69,7 @@ class NotionClient(LoggingMixin):
69
69
  """
70
70
  return await self._make_request(HttpMethod.GET, endpoint)
71
71
 
72
- # TODO: Get Blocks implementeren und Patch Blcoks hierfür das Typing finden:
73
-
74
- async def get_database(self, database_id: str) -> NotionDatabaserResponse:
72
+ async def get_database(self, database_id: str) -> NotionDatabaseResponse:
75
73
  """
76
74
  Ruft die Metadaten einer Notion-Datenbank anhand ihrer ID ab und gibt sie als NotionPageResponse zurück.
77
75
 
@@ -81,7 +79,7 @@ class NotionClient(LoggingMixin):
81
79
  Returns:
82
80
  Ein NotionPageResponse-Objekt mit den Datenbankmetadaten.
83
81
  """
84
- return NotionDatabaserResponse.model_validate(
82
+ return NotionDatabaseResponse.model_validate(
85
83
  await self.get(f"databases/{database_id}")
86
84
  )
87
85
 
@@ -20,14 +20,19 @@ class MarkdownSyntaxPromptGenerator:
20
20
  """
21
21
  Lädt das Prompt-Template aus der Markdown-Datei.
22
22
  """
23
- current_dir = Path(__file__).parent
24
- template_path = current_dir / "res/notion_syntax_prompt.md"
23
+ current_file = Path(__file__).resolve()
24
+ current_dir = current_file.parent
25
+ template_path = current_dir / "res" / "notion_syntax_prompt.md"
25
26
 
26
27
  try:
27
28
  with open(template_path, "r", encoding="utf-8") as file:
28
29
  return file.read()
29
30
  except FileNotFoundError:
30
- raise FileNotFoundError(f"Template file not found at {template_path}")
31
+ raise FileNotFoundError(
32
+ f"Template file not found at {template_path}\n"
33
+ f"Current working directory: {os.getcwd()}\n"
34
+ f"Script location: {current_file}"
35
+ )
31
36
  except Exception as e:
32
37
  raise RuntimeError(f"Error loading template file: {e}")
33
38
 
@@ -89,4 +94,4 @@ class MarkdownSyntaxPromptGenerator:
89
94
  # Erstelle eine Instanz, um das Template zu laden
90
95
  instance = cls()
91
96
  element_docs = cls.generate_element_docs(element_classes)
92
- return instance.SYSTEM_PROMPT_TEMPLATE.format(element_docs=element_docs)
97
+ return instance.SYSTEM_PROMPT_TEMPLATE.format(element_docs=element_docs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notionary
3
- Version: 0.2.1
3
+ Version: 0.2.3
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
@@ -1,5 +1,5 @@
1
1
  notionary/__init__.py,sha256=hPvZ-iqt5R_dAs9KaRBhC5eXzuQ5uvt-9EaU2O_7bZw,691
2
- notionary/notion_client.py,sha256=sJJMB36DqL0abcG-5w_plUDeS-zn1x0LpCgVNYeKqx0,7413
2
+ notionary/notion_client.py,sha256=O-lvy2-jMNSDc_8cWKuGVfckCdc1_PiQOlfxQKjQ6_A,7325
3
3
  notionary/database/database_discovery.py,sha256=qDGFhXG9s-_6CXdRg8tMiwX4dvX7jLjgAUFPSNlYtlI,4506
4
4
  notionary/database/notion_database.py,sha256=zbHPejETr101pprd7kewZ555d_TONN_wJi7b9Eyfoyg,7634
5
5
  notionary/database/notion_database_factory.py,sha256=FmijGYz6A4mCWVionOg9sxgFXfb9he52xdgNswJw24k,6584
@@ -25,11 +25,11 @@ notionary/elements/toggle_element.py,sha256=h9vYkkAIUHzn-0mu31qC6UPdlk_0EFIsU5A4
25
25
  notionary/elements/toggleable_heading_element.py,sha256=XdaPsd8anufwAACL8J-Egd_RcqPqZ1gFlzeol1GOyyc,9960
26
26
  notionary/elements/video_element.py,sha256=y0OmOYXdQBc2rSYAHRmA4l4rzNqPnyhuXbEipcgzQgY,5727
27
27
  notionary/elements/registry/block_registry.py,sha256=giWGcdgc3Z60wvfUr-FS6UMc-k-Q6DlXO8T0gl4fVC8,5027
28
- notionary/elements/registry/block_registry_builder.py,sha256=5dQhWiJ7jsyKUin1y7r-1Cmp0oOEAIfh6g91w8O4ydI,9319
28
+ notionary/elements/registry/block_registry_builder.py,sha256=Wnob3PbgzVAoXBW0Eon1KzX4aD4d36KeaDe_uYIKFnU,9311
29
29
  notionary/exceptions/database_exceptions.py,sha256=I-Tx6bYRLpi5pjGPtbT-Mqxvz3BFgYTiuZxknJeLxtI,2638
30
30
  notionary/exceptions/page_creation_exception.py,sha256=4v7IuZD6GsQLrqhDLriGjuG3ML638gAO53zDCrLePuU,281
31
31
  notionary/models/notion_block_response.py,sha256=gzL4C6K9QPcaMS6NbAZaRceSEnMbNwYBVVzxysza5VU,6002
32
- notionary/models/notion_database_response.py,sha256=Ij8XZniAi2BGjKn2fzT7auCAYAnTzL-jPTUjj5uH7i0,1240
32
+ notionary/models/notion_database_response.py,sha256=FMAasQP20S12J_KMdMlNpcHHwxFKX2YtbE4Q9xn-ruQ,1213
33
33
  notionary/models/notion_page_response.py,sha256=r4fwMwwDocj92JdbSmyrzIqBKsnEaz4aDUiPabrg9BM,1762
34
34
  notionary/page/markdown_to_notion_converter.py,sha256=EuqUGNv2HZu67INOnGheeJkt7WHTWGuLnhEG72_Wv5Y,15833
35
35
  notionary/page/notion_page.py,sha256=NDxAJaNk4tlKUrenhKBdnuvjlVgnxC0Z6fprf2LyNeE,18046
@@ -49,12 +49,12 @@ notionary/page/relations/notion_page_relation_manager.py,sha256=tfkvLHClaYel_uEa
49
49
  notionary/page/relations/notion_page_title_resolver.py,sha256=dIjiEeHjjNT-DrIhz1nynkfHkMpUuJJFOEjb25Wy7f4,3575
50
50
  notionary/page/relations/page_database_relation.py,sha256=8lEp8fQjPwjWhA8nZu3k8mW6EEc54ki1Uwf4iUV1DOU,2245
51
51
  notionary/prompting/element_prompt_content.py,sha256=tHref-SKA81Ua_IQD2Km7y7BvFtHl74haSIjHNYE3FE,4403
52
- notionary/prompting/markdown_syntax_prompt_generator.py,sha256=xKzTF62SFKzadyC7FHcOxWueRzkKiJ054pBHu9B4aLg,3155
52
+ notionary/prompting/markdown_syntax_prompt_generator.py,sha256=N6t9FHS_4IP9L5-zFpTM6iS7E-QJvoe7muPwEnF3UgQ,3352
53
53
  notionary/util/logging_mixin.py,sha256=b6wHj0IoVSWXbHh0yynfJlwvIR33G2qmaGNzrqyb7Gs,1825
54
54
  notionary/util/page_id_utils.py,sha256=EYNMxgf-7ghzL5K8lKZBZfW7g5CsdY0Xuj4IYmU8RPk,1381
55
55
  notionary/util/warn_direct_constructor_usage.py,sha256=vyJR73F95XVSRWIbyij-82IGOpAne9SBPM25eDpZfSU,1715
56
- notionary-0.2.1.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
57
- notionary-0.2.1.dist-info/METADATA,sha256=04JTDDeBzzGnqJw8Rk6S9kvIfg3KktmQnmRRMj3tihc,8374
58
- notionary-0.2.1.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
59
- notionary-0.2.1.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
60
- notionary-0.2.1.dist-info/RECORD,,
56
+ notionary-0.2.3.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
57
+ notionary-0.2.3.dist-info/METADATA,sha256=5GDY-SZ4tVpUd_3KdQo6jNWMc7PCv4sQWHuAhnL3ALs,8374
58
+ notionary-0.2.3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
59
+ notionary-0.2.3.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
60
+ notionary-0.2.3.dist-info/RECORD,,