notionary 0.1.23__tar.gz → 0.1.25__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 (63) hide show
  1. {notionary-0.1.23 → notionary-0.1.25}/PKG-INFO +1 -1
  2. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/code_block_element.py +2 -2
  3. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/prompts/element_prompt_content.py +1 -2
  4. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/prompts/synthax_prompt_builder.py +1 -1
  5. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/registry/block_element_registry.py +1 -1
  6. {notionary-0.1.23 → notionary-0.1.25}/notionary/notion_client.py +1 -1
  7. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/content/page_content_manager.py +12 -2
  8. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/notion_page.py +4 -2
  9. {notionary-0.1.23 → notionary-0.1.25}/notionary.egg-info/PKG-INFO +1 -1
  10. {notionary-0.1.23 → notionary-0.1.25}/setup.py +1 -1
  11. {notionary-0.1.23 → notionary-0.1.25}/LICENSE +0 -0
  12. {notionary-0.1.23 → notionary-0.1.25}/README.md +0 -0
  13. {notionary-0.1.23 → notionary-0.1.25}/notionary/__init__.py +0 -0
  14. {notionary-0.1.23 → notionary-0.1.25}/notionary/database/database_discovery.py +0 -0
  15. {notionary-0.1.23 → notionary-0.1.25}/notionary/database/database_info_service.py +0 -0
  16. {notionary-0.1.23 → notionary-0.1.25}/notionary/database/models/page_result.py +0 -0
  17. {notionary-0.1.23 → notionary-0.1.25}/notionary/database/notion_database.py +0 -0
  18. {notionary-0.1.23 → notionary-0.1.25}/notionary/database/notion_database_factory.py +0 -0
  19. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/audio_element.py +0 -0
  20. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/bookmark_element.py +0 -0
  21. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/bulleted_list_element.py +0 -0
  22. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/callout_element.py +0 -0
  23. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/column_element.py +0 -0
  24. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/divider_element.py +0 -0
  25. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/embed_element.py +0 -0
  26. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/heading_element.py +0 -0
  27. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/image_element.py +0 -0
  28. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/mention_element.py +0 -0
  29. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/notion_block_element.py +0 -0
  30. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/numbered_list_element.py +0 -0
  31. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/paragraph_element.py +0 -0
  32. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/qoute_element.py +0 -0
  33. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/registry/block_element_registry_builder.py +0 -0
  34. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/table_element.py +0 -0
  35. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/text_inline_formatter.py +0 -0
  36. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/todo_lists.py +0 -0
  37. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/toggle_element.py +0 -0
  38. {notionary-0.1.23 → notionary-0.1.25}/notionary/elements/video_element.py +0 -0
  39. {notionary-0.1.23 → notionary-0.1.25}/notionary/exceptions/database_exceptions.py +0 -0
  40. {notionary-0.1.23 → notionary-0.1.25}/notionary/exceptions/page_creation_exception.py +0 -0
  41. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/content/notion_page_content_chunker.py +0 -0
  42. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/markdown_to_notion_converter.py +0 -0
  43. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/metadata/metadata_editor.py +0 -0
  44. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/metadata/notion_icon_manager.py +0 -0
  45. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/metadata/notion_page_cover_manager.py +0 -0
  46. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/notion_page_factory.py +0 -0
  47. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/notion_to_markdown_converter.py +0 -0
  48. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/properites/database_property_service.py +0 -0
  49. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/properites/page_property_manager.py +0 -0
  50. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/properites/property_formatter.py +0 -0
  51. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/properites/property_operation_result.py +0 -0
  52. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/properites/property_value_extractor.py +0 -0
  53. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/relations/notion_page_relation_manager.py +0 -0
  54. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/relations/notion_page_title_resolver.py +0 -0
  55. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/relations/page_database_relation.py +0 -0
  56. {notionary-0.1.23 → notionary-0.1.25}/notionary/page/relations/relation_operation_result.py +0 -0
  57. {notionary-0.1.23 → notionary-0.1.25}/notionary/util/logging_mixin.py +0 -0
  58. {notionary-0.1.23 → notionary-0.1.25}/notionary/util/page_id_utils.py +0 -0
  59. {notionary-0.1.23 → notionary-0.1.25}/notionary.egg-info/SOURCES.txt +0 -0
  60. {notionary-0.1.23 → notionary-0.1.25}/notionary.egg-info/dependency_links.txt +0 -0
  61. {notionary-0.1.23 → notionary-0.1.25}/notionary.egg-info/requires.txt +0 -0
  62. {notionary-0.1.23 → notionary-0.1.25}/notionary.egg-info/top_level.txt +0 -0
  63. {notionary-0.1.23 → notionary-0.1.25}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notionary
3
- Version: 0.1.23
3
+ Version: 0.1.25
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
@@ -155,5 +155,5 @@ class CodeBlockElement(NotionBlockElement):
155
155
  '```json\n{"name": "Alice", "age": 30}\n```',
156
156
  "```mermaid\nflowchart TD\n A --> B\n```",
157
157
  ],
158
- "avoid": "NEVER EVER wrap markdown content with ```markdown. Markdown should be written directly without code block formatting. NEVER use ```markdown under any circumstances."
159
- }
158
+ "avoid": "NEVER EVER wrap markdown content with ```markdown. Markdown should be written directly without code block formatting. NEVER use ```markdown under any circumstances.",
159
+ }
@@ -18,7 +18,6 @@ class ElementPromptContent(TypedDict):
18
18
 
19
19
  when_to_use: str
20
20
  """Guidelines explaining the appropriate scenarios for using this element."""
21
-
21
+
22
22
  avoid: NotRequired[str]
23
23
  """Optional field listing scenarios when this element should be avoided."""
24
-
@@ -67,7 +67,7 @@ CRITICAL USAGE GUIDELINES:
67
67
  f"**Example:** {content['examples'][0]}" if content["examples"] else "",
68
68
  f"**When to use:** {content['when_to_use']}",
69
69
  ]
70
-
70
+
71
71
  if "avoid" in content and content["avoid"]:
72
72
  doc_parts.append(f"**Avoid:** {content['avoid']}")
73
73
 
@@ -33,7 +33,7 @@ class BlockElementRegistry:
33
33
  self._elements.remove(element_class)
34
34
  return True
35
35
  return False
36
-
36
+
37
37
  def contains(self, element_class: Type[NotionBlockElement]) -> bool:
38
38
  """
39
39
  Check if the registry contains the specified element class.
@@ -46,7 +46,7 @@ class NotionClient(LoggingMixin):
46
46
  for instance in list(cls._instances):
47
47
  await instance.close()
48
48
 
49
- async def close(self): #
49
+ async def close(self):
50
50
  """
51
51
  Closes the HTTP client for this instance and releases resources.
52
52
  """
@@ -32,14 +32,24 @@ class PageContentManager(LoggingMixin):
32
32
  )
33
33
  self._chunker = NotionPageContentChunker()
34
34
 
35
- async def append_markdown(self, markdown_text: str) -> str:
35
+ async def append_markdown(
36
+ self, markdown_text: str, append_divider: bool = False
37
+ ) -> str:
36
38
  """
37
39
  Append markdown text to a Notion page, automatically handling content length limits.
38
40
  First strips out triple backtick markdown fences if they wrap the entire content.
41
+
42
+ Args:
43
+ markdown_text: The markdown text to append
44
+ append_divider: If True, appends a divider after the markdown content (default: False)
39
45
  """
40
46
  try:
41
47
  blocks = self._markdown_to_notion_converter.convert(markdown_text)
42
48
 
49
+ if append_divider:
50
+ divider_block = {"type": "divider", "divider": {}}
51
+ blocks.append(divider_block)
52
+
43
53
  fixed_blocks = self._chunker.fix_blocks_content_length(blocks)
44
54
 
45
55
  result = await self._client.patch(
@@ -172,4 +182,4 @@ class PageContentManager(LoggingMixin):
172
182
 
173
183
  async def get_text(self) -> str:
174
184
  blocks = await self.get_page_blocks_with_children()
175
- return self._notion_to_markdown_converter.convert(blocks)
185
+ return self._notion_to_markdown_converter.convert(blocks)
@@ -130,7 +130,7 @@ class NotionPage(LoggingMixin):
130
130
  self._url_loaded = True
131
131
  return self._url
132
132
 
133
- async def append_markdown(self, markdown: str) -> str:
133
+ async def append_markdown(self, markdown: str, append_divider=False) -> str:
134
134
  """
135
135
  Append markdown content to the page.
136
136
 
@@ -140,7 +140,9 @@ class NotionPage(LoggingMixin):
140
140
  Returns:
141
141
  str: Status or confirmation message.
142
142
  """
143
- return await self._page_content_manager.append_markdown(markdown)
143
+ return await self._page_content_manager.append_markdown(
144
+ markdown_text=markdown, append_divider=append_divider
145
+ )
144
146
 
145
147
  async def clear(self) -> str:
146
148
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: notionary
3
- Version: 0.1.23
3
+ Version: 0.1.25
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name="notionary",
5
- version="0.1.23",
5
+ version="0.1.25",
6
6
  packages=find_namespace_packages(include=["notionary*"]),
7
7
  install_requires=[
8
8
  "httpx>=0.28.0",
File without changes
File without changes
File without changes