notionary 0.2.19__tar.gz → 0.2.22__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 (287) hide show
  1. notionary-0.2.22/PKG-INFO +237 -0
  2. notionary-0.2.22/README.md +212 -0
  3. {notionary-0.2.19 → notionary-0.2.22}/notionary/__init__.py +8 -4
  4. {notionary-0.2.19 → notionary-0.2.22}/notionary/base_notion_client.py +3 -1
  5. notionary-0.2.22/notionary/blocks/__init__.py +3 -0
  6. notionary-0.2.22/notionary/blocks/_bootstrap.py +271 -0
  7. notionary-0.2.22/notionary/blocks/audio/__init__.py +13 -0
  8. notionary-0.2.22/notionary/blocks/audio/audio_element.py +115 -0
  9. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/audio/audio_markdown_node.py +13 -5
  10. notionary-0.2.22/notionary/blocks/audio/audio_models.py +10 -0
  11. notionary-0.2.22/notionary/blocks/base_block_element.py +42 -0
  12. notionary-0.2.22/notionary/blocks/bookmark/__init__.py +14 -0
  13. notionary-0.2.22/notionary/blocks/bookmark/bookmark_element.py +83 -0
  14. notionary-0.2.22/notionary/blocks/bookmark/bookmark_markdown_node.py +44 -0
  15. notionary-0.2.22/notionary/blocks/bookmark/bookmark_models.py +15 -0
  16. notionary-0.2.22/notionary/blocks/breadcrumbs/__init__.py +17 -0
  17. notionary-0.2.22/notionary/blocks/breadcrumbs/breadcrumb_element.py +39 -0
  18. notionary-0.2.22/notionary/blocks/breadcrumbs/breadcrumb_markdown_node.py +32 -0
  19. notionary-0.2.22/notionary/blocks/breadcrumbs/breadcrumb_models.py +12 -0
  20. notionary-0.2.22/notionary/blocks/bulleted_list/__init__.py +17 -0
  21. notionary-0.2.22/notionary/blocks/bulleted_list/bulleted_list_element.py +74 -0
  22. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/bulleted_list/bulleted_list_markdown_node.py +2 -1
  23. notionary-0.2.22/notionary/blocks/bulleted_list/bulleted_list_models.py +18 -0
  24. notionary-0.2.22/notionary/blocks/callout/__init__.py +14 -0
  25. notionary-0.2.22/notionary/blocks/callout/callout_element.py +99 -0
  26. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/callout/callout_markdown_node.py +3 -1
  27. notionary-0.2.22/notionary/blocks/callout/callout_models.py +33 -0
  28. notionary-0.2.22/notionary/blocks/child_database/__init__.py +14 -0
  29. notionary-0.2.22/notionary/blocks/child_database/child_database_element.py +61 -0
  30. notionary-0.2.22/notionary/blocks/child_database/child_database_models.py +12 -0
  31. notionary-0.2.22/notionary/blocks/child_page/__init__.py +9 -0
  32. notionary-0.2.22/notionary/blocks/child_page/child_page_element.py +94 -0
  33. notionary-0.2.22/notionary/blocks/child_page/child_page_models.py +12 -0
  34. notionary-0.2.19/notionary/blocks/shared/block_client.py → notionary-0.2.22/notionary/blocks/client.py +54 -54
  35. notionary-0.2.22/notionary/blocks/code/__init__.py +11 -0
  36. notionary-0.2.22/notionary/blocks/code/code_element.py +149 -0
  37. notionary-0.2.22/notionary/blocks/code/code_markdown_node.py +94 -0
  38. notionary-0.2.22/notionary/blocks/code/code_models.py +94 -0
  39. notionary-0.2.22/notionary/blocks/column/__init__.py +29 -0
  40. notionary-0.2.22/notionary/blocks/column/column_element.py +65 -0
  41. notionary-0.2.22/notionary/blocks/column/column_list_element.py +52 -0
  42. notionary-0.2.22/notionary/blocks/column/column_list_markdown_node.py +50 -0
  43. notionary-0.2.22/notionary/blocks/column/column_markdown_node.py +59 -0
  44. notionary-0.2.22/notionary/blocks/column/column_models.py +26 -0
  45. notionary-0.2.22/notionary/blocks/divider/__init__.py +14 -0
  46. notionary-0.2.22/notionary/blocks/divider/divider_element.py +41 -0
  47. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/divider/divider_markdown_node.py +2 -1
  48. notionary-0.2.22/notionary/blocks/divider/divider_models.py +12 -0
  49. notionary-0.2.22/notionary/blocks/embed/__init__.py +14 -0
  50. notionary-0.2.22/notionary/blocks/embed/embed_element.py +98 -0
  51. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/embed/embed_markdown_node.py +3 -1
  52. notionary-0.2.22/notionary/blocks/embed/embed_models.py +14 -0
  53. notionary-0.2.22/notionary/blocks/equation/__init__.py +14 -0
  54. notionary-0.2.22/notionary/blocks/equation/equation_element.py +133 -0
  55. notionary-0.2.22/notionary/blocks/equation/equation_element_markdown_node.py +35 -0
  56. notionary-0.2.22/notionary/blocks/equation/equation_models.py +11 -0
  57. notionary-0.2.22/notionary/blocks/file/__init__.py +25 -0
  58. notionary-0.2.22/notionary/blocks/file/file_element.py +112 -0
  59. notionary-0.2.22/notionary/blocks/file/file_element_markdown_node.py +37 -0
  60. notionary-0.2.22/notionary/blocks/file/file_element_models.py +39 -0
  61. notionary-0.2.22/notionary/blocks/guards.py +22 -0
  62. notionary-0.2.22/notionary/blocks/heading/__init__.py +21 -0
  63. notionary-0.2.22/notionary/blocks/heading/heading_element.py +112 -0
  64. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/heading/heading_markdown_node.py +2 -1
  65. notionary-0.2.22/notionary/blocks/heading/heading_models.py +29 -0
  66. notionary-0.2.22/notionary/blocks/image_block/__init__.py +13 -0
  67. notionary-0.2.22/notionary/blocks/image_block/image_element.py +89 -0
  68. {notionary-0.2.19/notionary/blocks/image → notionary-0.2.22/notionary/blocks/image_block}/image_markdown_node.py +13 -6
  69. notionary-0.2.22/notionary/blocks/image_block/image_models.py +10 -0
  70. notionary-0.2.22/notionary/blocks/mixins/captions/__init__.py +4 -0
  71. notionary-0.2.22/notionary/blocks/mixins/captions/caption_markdown_node_mixin.py +31 -0
  72. notionary-0.2.22/notionary/blocks/mixins/captions/caption_mixin.py +92 -0
  73. notionary-0.2.22/notionary/blocks/models.py +174 -0
  74. notionary-0.2.22/notionary/blocks/numbered_list/__init__.py +17 -0
  75. notionary-0.2.22/notionary/blocks/numbered_list/numbered_list_element.py +65 -0
  76. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/numbered_list/numbered_list_markdown_node.py +3 -1
  77. notionary-0.2.22/notionary/blocks/numbered_list/numbered_list_models.py +17 -0
  78. notionary-0.2.22/notionary/blocks/paragraph/__init__.py +17 -0
  79. notionary-0.2.22/notionary/blocks/paragraph/paragraph_element.py +58 -0
  80. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/paragraph/paragraph_markdown_node.py +2 -1
  81. notionary-0.2.22/notionary/blocks/paragraph/paragraph_models.py +16 -0
  82. notionary-0.2.22/notionary/blocks/pdf/__init__.py +13 -0
  83. notionary-0.2.22/notionary/blocks/pdf/pdf_element.py +97 -0
  84. notionary-0.2.22/notionary/blocks/pdf/pdf_markdown_node.py +37 -0
  85. notionary-0.2.22/notionary/blocks/pdf/pdf_models.py +11 -0
  86. notionary-0.2.22/notionary/blocks/quote/__init__.py +16 -0
  87. notionary-0.2.22/notionary/blocks/quote/quote_element.py +75 -0
  88. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/quote/quote_markdown_node.py +6 -3
  89. notionary-0.2.22/notionary/blocks/quote/quote_models.py +18 -0
  90. notionary-0.2.22/notionary/blocks/registry/__init__.py +4 -0
  91. notionary-0.2.22/notionary/blocks/registry/block_registry.py +95 -0
  92. notionary-0.2.22/notionary/blocks/registry/block_registry_builder.py +264 -0
  93. notionary-0.2.22/notionary/blocks/rich_text/__init__.py +33 -0
  94. notionary-0.2.22/notionary/blocks/rich_text/name_to_id_resolver.py +205 -0
  95. notionary-0.2.22/notionary/blocks/rich_text/rich_text_models.py +221 -0
  96. notionary-0.2.22/notionary/blocks/rich_text/text_inline_formatter.py +456 -0
  97. notionary-0.2.22/notionary/blocks/syntax_prompt_builder.py +137 -0
  98. notionary-0.2.22/notionary/blocks/table/__init__.py +21 -0
  99. notionary-0.2.22/notionary/blocks/table/table_element.py +225 -0
  100. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/table/table_markdown_node.py +2 -1
  101. notionary-0.2.22/notionary/blocks/table/table_models.py +28 -0
  102. notionary-0.2.22/notionary/blocks/table_of_contents/__init__.py +19 -0
  103. notionary-0.2.22/notionary/blocks/table_of_contents/table_of_contents_element.py +68 -0
  104. notionary-0.2.22/notionary/blocks/table_of_contents/table_of_contents_markdown_node.py +35 -0
  105. notionary-0.2.22/notionary/blocks/table_of_contents/table_of_contents_models.py +18 -0
  106. notionary-0.2.22/notionary/blocks/todo/__init__.py +14 -0
  107. notionary-0.2.22/notionary/blocks/todo/todo_element.py +81 -0
  108. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/todo/todo_markdown_node.py +2 -1
  109. notionary-0.2.22/notionary/blocks/todo/todo_models.py +19 -0
  110. notionary-0.2.22/notionary/blocks/toggle/__init__.py +14 -0
  111. notionary-0.2.22/notionary/blocks/toggle/toggle_element.py +112 -0
  112. notionary-0.2.22/notionary/blocks/toggle/toggle_markdown_node.py +45 -0
  113. notionary-0.2.22/notionary/blocks/toggle/toggle_models.py +17 -0
  114. notionary-0.2.22/notionary/blocks/toggleable_heading/__init__.py +13 -0
  115. notionary-0.2.22/notionary/blocks/toggleable_heading/toggleable_heading_element.py +115 -0
  116. notionary-0.2.22/notionary/blocks/toggleable_heading/toggleable_heading_markdown_node.py +51 -0
  117. notionary-0.2.22/notionary/blocks/types.py +130 -0
  118. notionary-0.2.22/notionary/blocks/video/__init__.py +13 -0
  119. notionary-0.2.22/notionary/blocks/video/video_element.py +111 -0
  120. notionary-0.2.22/notionary/blocks/video/video_element_models.py +10 -0
  121. {notionary-0.2.19 → notionary-0.2.22}/notionary/blocks/video/video_markdown_node.py +13 -6
  122. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/client.py +26 -8
  123. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/database.py +13 -14
  124. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/database_filter_builder.py +2 -2
  125. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/database_provider.py +5 -4
  126. notionary-0.2.19/notionary/models/notion_database_response.py → notionary-0.2.22/notionary/database/models.py +5 -6
  127. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/notion_database.py +6 -7
  128. {notionary-0.2.19 → notionary-0.2.22}/notionary/file_upload/client.py +5 -7
  129. {notionary-0.2.19 → notionary-0.2.22}/notionary/file_upload/models.py +3 -2
  130. {notionary-0.2.19 → notionary-0.2.22}/notionary/file_upload/notion_file_upload.py +2 -3
  131. notionary-0.2.22/notionary/markdown/markdown_builder.py +729 -0
  132. notionary-0.2.22/notionary/markdown/markdown_document_model.py +228 -0
  133. {notionary-0.2.19/notionary/blocks → notionary-0.2.22/notionary/markdown}/markdown_node.py +1 -0
  134. {notionary-0.2.19 → notionary-0.2.22}/notionary/page/client.py +34 -15
  135. notionary-0.2.22/notionary/page/models.py +327 -0
  136. {notionary-0.2.19 → notionary-0.2.22}/notionary/page/notion_page.py +136 -58
  137. notionary-0.2.19/notionary/page/content/page_content_writer.py → notionary-0.2.22/notionary/page/page_content_deleting_service.py +25 -59
  138. notionary-0.2.22/notionary/page/page_content_writer.py +177 -0
  139. notionary-0.2.22/notionary/page/page_context.py +65 -0
  140. notionary-0.2.22/notionary/page/reader/handler/__init__.py +19 -0
  141. notionary-0.2.22/notionary/page/reader/handler/base_block_renderer.py +44 -0
  142. notionary-0.2.22/notionary/page/reader/handler/block_processing_context.py +35 -0
  143. notionary-0.2.22/notionary/page/reader/handler/block_rendering_context.py +48 -0
  144. notionary-0.2.22/notionary/page/reader/handler/column_list_renderer.py +51 -0
  145. notionary-0.2.22/notionary/page/reader/handler/column_renderer.py +60 -0
  146. notionary-0.2.22/notionary/page/reader/handler/line_renderer.py +73 -0
  147. notionary-0.2.22/notionary/page/reader/handler/numbered_list_renderer.py +85 -0
  148. notionary-0.2.22/notionary/page/reader/handler/toggle_renderer.py +69 -0
  149. notionary-0.2.22/notionary/page/reader/handler/toggleable_heading_renderer.py +89 -0
  150. notionary-0.2.22/notionary/page/reader/page_content_retriever.py +81 -0
  151. {notionary-0.2.19 → notionary-0.2.22}/notionary/page/search_filter_builder.py +2 -1
  152. notionary-0.2.22/notionary/page/writer/handler/__init__.py +24 -0
  153. notionary-0.2.22/notionary/page/writer/handler/code_handler.py +72 -0
  154. notionary-0.2.22/notionary/page/writer/handler/column_handler.py +141 -0
  155. notionary-0.2.22/notionary/page/writer/handler/column_list_handler.py +139 -0
  156. notionary-0.2.22/notionary/page/writer/handler/equation_handler.py +74 -0
  157. notionary-0.2.22/notionary/page/writer/handler/line_handler.py +35 -0
  158. notionary-0.2.22/notionary/page/writer/handler/line_processing_context.py +54 -0
  159. notionary-0.2.22/notionary/page/writer/handler/regular_line_handler.py +86 -0
  160. notionary-0.2.22/notionary/page/writer/handler/table_handler.py +66 -0
  161. notionary-0.2.22/notionary/page/writer/handler/toggle_handler.py +155 -0
  162. notionary-0.2.22/notionary/page/writer/handler/toggleable_heading_handler.py +173 -0
  163. notionary-0.2.22/notionary/page/writer/markdown_to_notion_converter.py +95 -0
  164. notionary-0.2.22/notionary/page/writer/markdown_to_notion_converter_context.py +30 -0
  165. notionary-0.2.22/notionary/page/writer/markdown_to_notion_formatting_post_processor.py +73 -0
  166. notionary-0.2.22/notionary/page/writer/notion_text_length_processor.py +150 -0
  167. {notionary-0.2.19 → notionary-0.2.22}/notionary/telemetry/__init__.py +2 -2
  168. {notionary-0.2.19 → notionary-0.2.22}/notionary/telemetry/service.py +3 -3
  169. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/__init__.py +2 -2
  170. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/base_notion_user.py +2 -1
  171. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/client.py +2 -3
  172. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/models.py +1 -0
  173. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/notion_bot_user.py +4 -5
  174. {notionary-0.2.19 → notionary-0.2.22}/notionary/user/notion_user.py +3 -4
  175. notionary-0.2.22/notionary/user/notion_user_manager.py +101 -0
  176. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/__init__.py +3 -2
  177. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/fuzzy.py +2 -1
  178. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/logging_mixin.py +2 -2
  179. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/singleton_metaclass.py +1 -1
  180. {notionary-0.2.19 → notionary-0.2.22}/notionary/workspace.py +6 -5
  181. {notionary-0.2.19 → notionary-0.2.22}/pyproject.toml +5 -2
  182. notionary-0.2.19/PKG-INFO +0 -225
  183. notionary-0.2.19/README.md +0 -201
  184. notionary-0.2.19/notionary/blocks/__init__.py +0 -92
  185. notionary-0.2.19/notionary/blocks/audio/__init__.py +0 -7
  186. notionary-0.2.19/notionary/blocks/audio/audio_element.py +0 -152
  187. notionary-0.2.19/notionary/blocks/audio/audio_models.py +0 -59
  188. notionary-0.2.19/notionary/blocks/bookmark/__init__.py +0 -7
  189. notionary-0.2.19/notionary/blocks/bookmark/bookmark_element.py +0 -173
  190. notionary-0.2.19/notionary/blocks/bookmark/bookmark_markdown_node.py +0 -43
  191. notionary-0.2.19/notionary/blocks/bulleted_list/__init__.py +0 -7
  192. notionary-0.2.19/notionary/blocks/bulleted_list/bulleted_list_element.py +0 -72
  193. notionary-0.2.19/notionary/blocks/callout/__init__.py +0 -7
  194. notionary-0.2.19/notionary/blocks/callout/callout_element.py +0 -132
  195. notionary-0.2.19/notionary/blocks/code/__init__.py +0 -7
  196. notionary-0.2.19/notionary/blocks/code/code_element.py +0 -234
  197. notionary-0.2.19/notionary/blocks/code/code_markdown_node.py +0 -43
  198. notionary-0.2.19/notionary/blocks/column/__init__.py +0 -5
  199. notionary-0.2.19/notionary/blocks/column/column_element.py +0 -333
  200. notionary-0.2.19/notionary/blocks/divider/__init__.py +0 -7
  201. notionary-0.2.19/notionary/blocks/divider/divider_element.py +0 -72
  202. notionary-0.2.19/notionary/blocks/document/__init__.py +0 -7
  203. notionary-0.2.19/notionary/blocks/document/document_element.py +0 -102
  204. notionary-0.2.19/notionary/blocks/document/document_markdown_node.py +0 -31
  205. notionary-0.2.19/notionary/blocks/embed/__init__.py +0 -7
  206. notionary-0.2.19/notionary/blocks/embed/embed_element.py +0 -144
  207. notionary-0.2.19/notionary/blocks/embed/embed_models.py +0 -0
  208. notionary-0.2.19/notionary/blocks/heading/__init__.py +0 -7
  209. notionary-0.2.19/notionary/blocks/heading/heading_element.py +0 -98
  210. notionary-0.2.19/notionary/blocks/heading/heading_models.py +0 -0
  211. notionary-0.2.19/notionary/blocks/image/__init__.py +0 -7
  212. notionary-0.2.19/notionary/blocks/image/image_element.py +0 -151
  213. notionary-0.2.19/notionary/blocks/image/image_models.py +0 -0
  214. notionary-0.2.19/notionary/blocks/markdown_builder.py +0 -356
  215. notionary-0.2.19/notionary/blocks/mention/__init__.py +0 -7
  216. notionary-0.2.19/notionary/blocks/mention/mention_element.py +0 -229
  217. notionary-0.2.19/notionary/blocks/mention/mention_markdown_node.py +0 -38
  218. notionary-0.2.19/notionary/blocks/mention/mention_models.py +0 -0
  219. notionary-0.2.19/notionary/blocks/numbered_list/__init__.py +0 -7
  220. notionary-0.2.19/notionary/blocks/numbered_list/numbered_list_element.py +0 -73
  221. notionary-0.2.19/notionary/blocks/numbered_list/numbered_list_models.py +0 -0
  222. notionary-0.2.19/notionary/blocks/paragraph/__init__.py +0 -7
  223. notionary-0.2.19/notionary/blocks/paragraph/paragraph_element.py +0 -84
  224. notionary-0.2.19/notionary/blocks/paragraph/paragraph_models.py +0 -0
  225. notionary-0.2.19/notionary/blocks/prompts/element_prompt_builder.py +0 -83
  226. notionary-0.2.19/notionary/blocks/prompts/element_prompt_content.py +0 -41
  227. notionary-0.2.19/notionary/blocks/quote/__init__.py +0 -7
  228. notionary-0.2.19/notionary/blocks/quote/quote_element.py +0 -92
  229. notionary-0.2.19/notionary/blocks/quote/quote_models.py +0 -0
  230. notionary-0.2.19/notionary/blocks/registry/block_registry.py +0 -156
  231. notionary-0.2.19/notionary/blocks/registry/block_registry_builder.py +0 -208
  232. notionary-0.2.19/notionary/blocks/shared/__init__.py +0 -0
  233. notionary-0.2.19/notionary/blocks/shared/models.py +0 -713
  234. notionary-0.2.19/notionary/blocks/shared/notion_block_element.py +0 -37
  235. notionary-0.2.19/notionary/blocks/shared/text_inline_formatter.py +0 -262
  236. notionary-0.2.19/notionary/blocks/shared/text_inline_formatter_new.py +0 -139
  237. notionary-0.2.19/notionary/blocks/table/__init__.py +0 -7
  238. notionary-0.2.19/notionary/blocks/table/table_element.py +0 -317
  239. notionary-0.2.19/notionary/blocks/table/table_models.py +0 -0
  240. notionary-0.2.19/notionary/blocks/todo/__init__.py +0 -7
  241. notionary-0.2.19/notionary/blocks/todo/todo_element.py +0 -121
  242. notionary-0.2.19/notionary/blocks/todo/todo_models.py +0 -0
  243. notionary-0.2.19/notionary/blocks/toggle/__init__.py +0 -4
  244. notionary-0.2.19/notionary/blocks/toggle/toggle_element.py +0 -303
  245. notionary-0.2.19/notionary/blocks/toggle/toggle_markdown_node.py +0 -35
  246. notionary-0.2.19/notionary/blocks/toggle/toggle_models.py +0 -0
  247. notionary-0.2.19/notionary/blocks/toggleable_heading/__init__.py +0 -9
  248. notionary-0.2.19/notionary/blocks/toggleable_heading/toggleable_heading_element.py +0 -270
  249. notionary-0.2.19/notionary/blocks/toggleable_heading/toggleable_heading_markdown_node.py +0 -43
  250. notionary-0.2.19/notionary/blocks/toggleable_heading/toggleable_heading_models.py +0 -0
  251. notionary-0.2.19/notionary/blocks/video/__init__.py +0 -7
  252. notionary-0.2.19/notionary/blocks/video/video_element.py +0 -182
  253. notionary-0.2.19/notionary/database/models/page_result.py +0 -10
  254. notionary-0.2.19/notionary/elements/__init__.py +0 -0
  255. notionary-0.2.19/notionary/models/notion_block_response.py +0 -264
  256. notionary-0.2.19/notionary/models/notion_page_response.py +0 -78
  257. notionary-0.2.19/notionary/models/search_response.py +0 -0
  258. notionary-0.2.19/notionary/page/__init__.py +0 -0
  259. notionary-0.2.19/notionary/page/content/markdown_whitespace_processor.py +0 -80
  260. notionary-0.2.19/notionary/page/content/notion_text_length_utils.py +0 -87
  261. notionary-0.2.19/notionary/page/content/page_content_retriever.py +0 -60
  262. notionary-0.2.19/notionary/page/formatting/line_processor.py +0 -153
  263. notionary-0.2.19/notionary/page/formatting/markdown_to_notion_converter.py +0 -153
  264. notionary-0.2.19/notionary/page/markdown_syntax_prompt_generator.py +0 -114
  265. notionary-0.2.19/notionary/page/notion_to_markdown_converter.py +0 -179
  266. notionary-0.2.19/notionary/page/properites/property_value_extractor.py +0 -0
  267. notionary-0.2.19/notionary/user/notion_user_manager.py +0 -173
  268. notionary-0.2.19/notionary/user/notion_user_provider.py +0 -1
  269. {notionary-0.2.19 → notionary-0.2.22}/LICENSE +0 -0
  270. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/__init__.py +0 -0
  271. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/exceptions.py +0 -0
  272. {notionary-0.2.19 → notionary-0.2.22}/notionary/database/factory.py +0 -0
  273. {notionary-0.2.19 → notionary-0.2.22}/notionary/file_upload/__init__.py +0 -0
  274. /notionary-0.2.19/notionary/blocks/bookmark/bookmark_models.py → /notionary-0.2.22/notionary/markdown/___init__.py +0 -0
  275. /notionary-0.2.19/notionary/blocks/bulleted_list/bulleted_list_models.py → /notionary-0.2.22/notionary/markdown/makdown_document_model.py +0 -0
  276. /notionary-0.2.19/notionary/blocks/callout/callout_models.py → /notionary-0.2.22/notionary/models/notion_database_response.py +0 -0
  277. {notionary-0.2.19 → notionary-0.2.22}/notionary/page/property_formatter.py +0 -0
  278. /notionary-0.2.19/notionary/blocks/code/code_models.py → /notionary-0.2.22/notionary/page/reader/handler/equation_renderer.py +0 -0
  279. {notionary-0.2.19 → notionary-0.2.22}/notionary/page/utils.py +0 -0
  280. /notionary-0.2.19/notionary/blocks/column/column_models.py → /notionary-0.2.22/notionary/page/writer/markdown_to_notion_post_processor.py +0 -0
  281. /notionary-0.2.19/notionary/blocks/divider/divider_models.py → /notionary-0.2.22/notionary/page/writer/markdown_to_notion_text_length_post_processor.py +0 -0
  282. {notionary-0.2.19 → notionary-0.2.22}/notionary/telemetry/views.py +0 -0
  283. /notionary-0.2.19/notionary/blocks/document/document_models.py → /notionary-0.2.22/notionary/util/concurrency_limiter.py +0 -0
  284. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/factory_decorator.py +0 -0
  285. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/factory_only.py +0 -0
  286. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/page_id_utils.py +0 -0
  287. {notionary-0.2.19 → notionary-0.2.22}/notionary/util/singleton.py +0 -0
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.3
2
+ Name: notionary
3
+ Version: 0.2.22
4
+ Summary: Python library for programmatic Notion workspace management - databases, pages, and content with advanced Markdown support
5
+ License: MIT
6
+ Author: Mathis Arends
7
+ Author-email: mathisarends27@gmail.com
8
+ Requires-Python: >=3.9
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
17
+ Requires-Dist: httpx (>=0.28.0)
18
+ Requires-Dist: isort (>=6.0.1,<7.0.0)
19
+ Requires-Dist: posthog (>=6.3.1,<7.0.0)
20
+ Requires-Dist: pydantic (>=2.11.4)
21
+ Requires-Dist: python-dotenv (>=1.1.0)
22
+ Project-URL: Homepage, https://github.com/mathisarends/notionary
23
+ Description-Content-Type: text/markdown
24
+
25
+ <picture>
26
+ <source media="(prefers-color-scheme: dark)" srcset="./static/notionary-dark.png">
27
+ <source media="(prefers-color-scheme: light)" srcset="./static/notionary-light.png">
28
+ <img alt="Notionary logo: dark mode shows a white logo, light mode shows a black logo." src="./static/browser-use.png" width="full">
29
+ </picture>
30
+
31
+ <h1 align="center">Notion API simplified for Python developers 🐍</h1>
32
+
33
+ <div align="center">
34
+
35
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
36
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
37
+ [![Documentation](https://img.shields.io/badge/docs-mathisarends.github.io-blue.svg)](https://mathisarends.github.io/notionary/)
38
+
39
+ Transform complex Notion API interactions into simple, Pythonic code. Build AI agents, automate workflows, and create dynamic content with ease.
40
+
41
+ </div>
42
+
43
+ ---
44
+
45
+ ## Why Notionary?
46
+
47
+ - **Smart Discovery**: Find pages and databases by name—no more hunting for URLs or IDs
48
+ - **Rich Markdown**: Convert extended Markdown (callouts, toggles, columns) directly into beautiful Notion blocks
49
+ - **Async-First**: Built for modern Python with full async/await support and high performance
50
+ - **AI-Ready**: Perfect foundation for AI agents that generate and manage Notion content
51
+ - **Round-Trip**: Read existing content, modify it, and write it back while preserving formatting
52
+
53
+ ---
54
+
55
+ ## Quick Start
56
+
57
+ ```bash
58
+ pip install notionary
59
+ ```
60
+
61
+ Set up your [Notion integration](https://www.notion.so/profile/integrations) and add your token:
62
+
63
+ ```bash
64
+ NOTION_SECRET=your_integration_key
65
+ ```
66
+
67
+ ### Simple Flow: Find → Create → Update
68
+
69
+ ```python
70
+ import asyncio
71
+ from notionary import NotionPage, NotionDatabase
72
+
73
+ async def main():
74
+ # Work with pages - find by name, no exact match needed!
75
+ page = await NotionPage.from_page_name("Meeting Notes")
76
+
77
+ # Direct Markdown - quick & intuitive
78
+ await page.append_markdown("""
79
+ ## Action Items
80
+ - Review project proposal
81
+ - Schedule team meeting
82
+ - Update documentation
83
+
84
+ [callout](Important meeting decisions require follow-up "💡")
85
+ """)
86
+
87
+ # Builder Pattern - type-safe & powerful for complex layouts
88
+ await page.append_markdown(lambda builder: (
89
+ builder
90
+ .h2("Project Status")
91
+ .callout("Project milestone reached!", "🎉")
92
+ .columns(
93
+ lambda col: (col
94
+ .h3("Completed")
95
+ .bulleted_list(["API design", "Database setup", "Authentication"])
96
+ ),
97
+ lambda col: (col
98
+ .h3("In Progress")
99
+ .bulleted_list(["Frontend UI", "Testing", "Documentation"])
100
+ )
101
+ )
102
+ .table(
103
+ headers=["Task", "Owner", "Due Date"],
104
+ rows=[
105
+ ["Launch prep", "Alice", "2024-03-15"],
106
+ ["Marketing", "Bob", "2024-03-20"]
107
+ ]
108
+ )
109
+ ))
110
+
111
+ asyncio.run(main())
112
+ ```
113
+
114
+ ### Create Rich Database Entries
115
+
116
+ ```python
117
+ # Work with databases - connect and create styled entries
118
+ db = await NotionDatabase.from_database_name("Projects")
119
+
120
+ # Create new project with full styling
121
+ project = await db.create_blank_page()
122
+ await project.set_title("New Marketing Campaign")
123
+ await project.set_emoji_icon("🚀")
124
+ await project.set_random_gradient_cover()
125
+
126
+ # Set database properties
127
+ await project.set_property_value_by_name("Status", "Planning")
128
+ await project.set_property_value_by_name("Priority", "High")
129
+ await project.set_property_value_by_name("Team Lead", "sarah@company.com")
130
+
131
+ # Add rich content to the new page
132
+ await project.replace_content(lambda builder: (
133
+ builder
134
+ .h1("Campaign Overview")
135
+ .callout("New marketing initiative targeting Q2 growth", "🎯")
136
+ .h2("Goals & Objectives")
137
+ .numbered_list([
138
+ "Increase brand awareness by 25%",
139
+ "Generate 500 qualified leads",
140
+ "Launch in 3 target markets"
141
+ ])
142
+ .h2("Budget Breakdown")
143
+ .table(
144
+ headers=["Category", "Allocated", "Spent", "Remaining"],
145
+ rows=[
146
+ ["Digital Ads", "$15,000", "$3,200", "$11,800"],
147
+ ["Content Creation", "$8,000", "$1,500", "$6,500"],
148
+ ["Events", "$12,000", "$0", "$12,000"]
149
+ ]
150
+ )
151
+ .divider()
152
+ .toggle("Technical Requirements", lambda toggle: (
153
+ toggle
154
+ .paragraph("Platform specifications and integration details.")
155
+ .bulleted_list([
156
+ "CRM integration with Salesforce",
157
+ "Analytics tracking setup",
158
+ "Landing page development"
159
+ ])
160
+ ))
161
+ ))
162
+
163
+ print(f"✅ Created styled project: {project.url}")
164
+ ```
165
+
166
+ ### Extended Markdown Syntax
167
+
168
+ Notionary supports rich formatting with callouts, toggles, multi-column layouts, tables, media embeds, and more. Use either direct markdown syntax or the type-safe builder pattern.
169
+
170
+ See the complete [Block Types documentation](https://mathisarends.github.io/notionary/blocks/) for all available formatting options and syntax examples.
171
+
172
+ ## What You Can Build
173
+
174
+ - **AI Content Generation** - Perfect for AI agents that create structured reports and documentation
175
+ - **Workflow Automation** - Update project status, sync data between databases, generate reports
176
+ - **Dynamic Documentation** - Auto-generate team docs, API references, and knowledge bases
177
+ - **Content Management** - Bulk page updates, template generation, and content migration
178
+
179
+ ## Core Features
180
+
181
+ | Feature | Description |
182
+ | -------------------- | ------------------------------------------------------ |
183
+ | **Smart Discovery** | Find pages/databases by name with fuzzy matching |
184
+ | **Rich Markdown** | Extended syntax for callouts, toggles, columns, tables |
185
+ | **Async-First** | Modern Python with full async/await support |
186
+ | **Round-Trip** | Read content as markdown, edit, and write back |
187
+ | **AI-Ready** | Generate system prompts for AI content creation |
188
+ | **All Block Types** | Support for every Notion block type |
189
+ | **Type Safety** | Full type hints for better IDE support |
190
+ | **High Performance** | Efficient batch operations and caching |
191
+
192
+ ## Examples & Documentation
193
+
194
+ Explore comprehensive guides and real-world examples:
195
+
196
+ - **[📖 Full Documentation](https://mathisarends.github.io/notionary/)** - Complete API reference and guides
197
+ - **[Getting Started](https://mathisarends.github.io/notionary/get-started/)** - Quick setup and first steps
198
+ - **[Page Management](https://mathisarends.github.io/notionary/page/)** - Work with page content and properties
199
+ - **[Database Operations](https://mathisarends.github.io/notionary/database/)** - Query and manage databases
200
+ - **[Block Types](https://mathisarends.github.io/notionary/blocks/)** - Complete formatting reference
201
+
202
+ Check out the `examples/` directory for hands-on tutorials:
203
+
204
+ ### Core Examples
205
+
206
+ - **[Page Management](examples/page_example.py)** - Create, update, and manage pages
207
+ - **[Database Operations](examples/database.py)** - Connect to and query databases
208
+ - **[Workspace Discovery](examples/workspace_discovery.py)** - Explore your workspace
209
+
210
+ ### Markdown Examples
211
+
212
+ - **[Basic Formatting](examples/markdown/basic.py)** - Text, lists, and links
213
+ - **[Callouts](examples/markdown/callout.py)** - Eye-catching information boxes
214
+ - **[Toggles](examples/markdown/toggle.py)** - Collapsible content sections
215
+ - **[Multi-Column](examples/markdown/columns.py)** - Side-by-side layouts
216
+ - **[Tables](examples/markdown/table.py)** - Structured data presentation
217
+
218
+ ## Contributing
219
+
220
+ We'd love your help making Notionary even better!
221
+
222
+ Whether it's fixing bugs, adding features, improving docs, or sharing examples - all contributions are welcome.
223
+
224
+ See our [Contributing Guide](https://mathisarends.github.io/notionary/contributing/) to get started.
225
+
226
+ ---
227
+
228
+ <div align="center">
229
+
230
+ **Ready to transform your Notion workflow?**
231
+
232
+ [📖 Read the Docs](https://mathisarends.github.io/notionary/) • [Getting Started](https://mathisarends.github.io/notionary/get-started/) • [Examples](examples/)
233
+
234
+ Built with ❤️ for the Python community
235
+
236
+ </div>
237
+
@@ -0,0 +1,212 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="./static/notionary-dark.png">
3
+ <source media="(prefers-color-scheme: light)" srcset="./static/notionary-light.png">
4
+ <img alt="Notionary logo: dark mode shows a white logo, light mode shows a black logo." src="./static/browser-use.png" width="full">
5
+ </picture>
6
+
7
+ <h1 align="center">Notion API simplified for Python developers 🐍</h1>
8
+
9
+ <div align="center">
10
+
11
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
12
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
13
+ [![Documentation](https://img.shields.io/badge/docs-mathisarends.github.io-blue.svg)](https://mathisarends.github.io/notionary/)
14
+
15
+ Transform complex Notion API interactions into simple, Pythonic code. Build AI agents, automate workflows, and create dynamic content with ease.
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ ## Why Notionary?
22
+
23
+ - **Smart Discovery**: Find pages and databases by name—no more hunting for URLs or IDs
24
+ - **Rich Markdown**: Convert extended Markdown (callouts, toggles, columns) directly into beautiful Notion blocks
25
+ - **Async-First**: Built for modern Python with full async/await support and high performance
26
+ - **AI-Ready**: Perfect foundation for AI agents that generate and manage Notion content
27
+ - **Round-Trip**: Read existing content, modify it, and write it back while preserving formatting
28
+
29
+ ---
30
+
31
+ ## Quick Start
32
+
33
+ ```bash
34
+ pip install notionary
35
+ ```
36
+
37
+ Set up your [Notion integration](https://www.notion.so/profile/integrations) and add your token:
38
+
39
+ ```bash
40
+ NOTION_SECRET=your_integration_key
41
+ ```
42
+
43
+ ### Simple Flow: Find → Create → Update
44
+
45
+ ```python
46
+ import asyncio
47
+ from notionary import NotionPage, NotionDatabase
48
+
49
+ async def main():
50
+ # Work with pages - find by name, no exact match needed!
51
+ page = await NotionPage.from_page_name("Meeting Notes")
52
+
53
+ # Direct Markdown - quick & intuitive
54
+ await page.append_markdown("""
55
+ ## Action Items
56
+ - Review project proposal
57
+ - Schedule team meeting
58
+ - Update documentation
59
+
60
+ [callout](Important meeting decisions require follow-up "💡")
61
+ """)
62
+
63
+ # Builder Pattern - type-safe & powerful for complex layouts
64
+ await page.append_markdown(lambda builder: (
65
+ builder
66
+ .h2("Project Status")
67
+ .callout("Project milestone reached!", "🎉")
68
+ .columns(
69
+ lambda col: (col
70
+ .h3("Completed")
71
+ .bulleted_list(["API design", "Database setup", "Authentication"])
72
+ ),
73
+ lambda col: (col
74
+ .h3("In Progress")
75
+ .bulleted_list(["Frontend UI", "Testing", "Documentation"])
76
+ )
77
+ )
78
+ .table(
79
+ headers=["Task", "Owner", "Due Date"],
80
+ rows=[
81
+ ["Launch prep", "Alice", "2024-03-15"],
82
+ ["Marketing", "Bob", "2024-03-20"]
83
+ ]
84
+ )
85
+ ))
86
+
87
+ asyncio.run(main())
88
+ ```
89
+
90
+ ### Create Rich Database Entries
91
+
92
+ ```python
93
+ # Work with databases - connect and create styled entries
94
+ db = await NotionDatabase.from_database_name("Projects")
95
+
96
+ # Create new project with full styling
97
+ project = await db.create_blank_page()
98
+ await project.set_title("New Marketing Campaign")
99
+ await project.set_emoji_icon("🚀")
100
+ await project.set_random_gradient_cover()
101
+
102
+ # Set database properties
103
+ await project.set_property_value_by_name("Status", "Planning")
104
+ await project.set_property_value_by_name("Priority", "High")
105
+ await project.set_property_value_by_name("Team Lead", "sarah@company.com")
106
+
107
+ # Add rich content to the new page
108
+ await project.replace_content(lambda builder: (
109
+ builder
110
+ .h1("Campaign Overview")
111
+ .callout("New marketing initiative targeting Q2 growth", "🎯")
112
+ .h2("Goals & Objectives")
113
+ .numbered_list([
114
+ "Increase brand awareness by 25%",
115
+ "Generate 500 qualified leads",
116
+ "Launch in 3 target markets"
117
+ ])
118
+ .h2("Budget Breakdown")
119
+ .table(
120
+ headers=["Category", "Allocated", "Spent", "Remaining"],
121
+ rows=[
122
+ ["Digital Ads", "$15,000", "$3,200", "$11,800"],
123
+ ["Content Creation", "$8,000", "$1,500", "$6,500"],
124
+ ["Events", "$12,000", "$0", "$12,000"]
125
+ ]
126
+ )
127
+ .divider()
128
+ .toggle("Technical Requirements", lambda toggle: (
129
+ toggle
130
+ .paragraph("Platform specifications and integration details.")
131
+ .bulleted_list([
132
+ "CRM integration with Salesforce",
133
+ "Analytics tracking setup",
134
+ "Landing page development"
135
+ ])
136
+ ))
137
+ ))
138
+
139
+ print(f"✅ Created styled project: {project.url}")
140
+ ```
141
+
142
+ ### Extended Markdown Syntax
143
+
144
+ Notionary supports rich formatting with callouts, toggles, multi-column layouts, tables, media embeds, and more. Use either direct markdown syntax or the type-safe builder pattern.
145
+
146
+ See the complete [Block Types documentation](https://mathisarends.github.io/notionary/blocks/) for all available formatting options and syntax examples.
147
+
148
+ ## What You Can Build
149
+
150
+ - **AI Content Generation** - Perfect for AI agents that create structured reports and documentation
151
+ - **Workflow Automation** - Update project status, sync data between databases, generate reports
152
+ - **Dynamic Documentation** - Auto-generate team docs, API references, and knowledge bases
153
+ - **Content Management** - Bulk page updates, template generation, and content migration
154
+
155
+ ## Core Features
156
+
157
+ | Feature | Description |
158
+ | -------------------- | ------------------------------------------------------ |
159
+ | **Smart Discovery** | Find pages/databases by name with fuzzy matching |
160
+ | **Rich Markdown** | Extended syntax for callouts, toggles, columns, tables |
161
+ | **Async-First** | Modern Python with full async/await support |
162
+ | **Round-Trip** | Read content as markdown, edit, and write back |
163
+ | **AI-Ready** | Generate system prompts for AI content creation |
164
+ | **All Block Types** | Support for every Notion block type |
165
+ | **Type Safety** | Full type hints for better IDE support |
166
+ | **High Performance** | Efficient batch operations and caching |
167
+
168
+ ## Examples & Documentation
169
+
170
+ Explore comprehensive guides and real-world examples:
171
+
172
+ - **[📖 Full Documentation](https://mathisarends.github.io/notionary/)** - Complete API reference and guides
173
+ - **[Getting Started](https://mathisarends.github.io/notionary/get-started/)** - Quick setup and first steps
174
+ - **[Page Management](https://mathisarends.github.io/notionary/page/)** - Work with page content and properties
175
+ - **[Database Operations](https://mathisarends.github.io/notionary/database/)** - Query and manage databases
176
+ - **[Block Types](https://mathisarends.github.io/notionary/blocks/)** - Complete formatting reference
177
+
178
+ Check out the `examples/` directory for hands-on tutorials:
179
+
180
+ ### Core Examples
181
+
182
+ - **[Page Management](examples/page_example.py)** - Create, update, and manage pages
183
+ - **[Database Operations](examples/database.py)** - Connect to and query databases
184
+ - **[Workspace Discovery](examples/workspace_discovery.py)** - Explore your workspace
185
+
186
+ ### Markdown Examples
187
+
188
+ - **[Basic Formatting](examples/markdown/basic.py)** - Text, lists, and links
189
+ - **[Callouts](examples/markdown/callout.py)** - Eye-catching information boxes
190
+ - **[Toggles](examples/markdown/toggle.py)** - Collapsible content sections
191
+ - **[Multi-Column](examples/markdown/columns.py)** - Side-by-side layouts
192
+ - **[Tables](examples/markdown/table.py)** - Structured data presentation
193
+
194
+ ## Contributing
195
+
196
+ We'd love your help making Notionary even better!
197
+
198
+ Whether it's fixing bugs, adding features, improving docs, or sharing examples - all contributions are welcome.
199
+
200
+ See our [Contributing Guide](https://mathisarends.github.io/notionary/contributing/) to get started.
201
+
202
+ ---
203
+
204
+ <div align="center">
205
+
206
+ **Ready to transform your Notion workflow?**
207
+
208
+ [📖 Read the Docs](https://mathisarends.github.io/notionary/) • [Getting Started](https://mathisarends.github.io/notionary/get-started/) • [Examples](examples/)
209
+
210
+ Built with ❤️ for the Python community
211
+
212
+ </div>
@@ -1,9 +1,13 @@
1
- from .database import NotionDatabase, DatabaseFilterBuilder
1
+ from notionary.blocks import bootstrap_blocks
2
+
3
+ bootstrap_blocks()
4
+
5
+ from .database import DatabaseFilterBuilder, NotionDatabase
6
+ from .file_upload import NotionFileUpload
7
+ from .markdown.markdown_builder import MarkdownBuilder
2
8
  from .page.notion_page import NotionPage
9
+ from .user import NotionBotUser, NotionUser, NotionUserManager
3
10
  from .workspace import NotionWorkspace
4
- from .user import NotionUser, NotionUserManager, NotionBotUser
5
- from .file_upload import NotionFileUpload
6
- from .blocks.markdown_builder import MarkdownBuilder
7
11
 
8
12
  __all__ = [
9
13
  "NotionDatabase",
@@ -2,9 +2,11 @@ import asyncio
2
2
  import os
3
3
  from abc import ABC
4
4
  from enum import Enum
5
- from typing import Dict, Any, Optional, Union
5
+ from typing import Any, Dict, Optional, Union
6
+
6
7
  import httpx
7
8
  from dotenv import load_dotenv
9
+
8
10
  from notionary.util import LoggingMixin
9
11
 
10
12
  load_dotenv()
@@ -0,0 +1,3 @@
1
+ from ._bootstrap import bootstrap_blocks
2
+
3
+ __all__ = ["bootstrap_blocks"]