better-notion 1.0.0__tar.gz → 1.1.0__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 (193) hide show
  1. {better_notion-1.0.0 → better_notion-1.1.0}/.gitignore +131 -131
  2. {better_notion-1.0.0 → better_notion-1.1.0}/PKG-INFO +2 -2
  3. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/client.py +106 -3
  4. better_notion-1.1.0/better_notion/_sdk/plugins.py +180 -0
  5. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/base.py +99 -1
  6. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/loader.py +51 -1
  7. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/official/agents.py +150 -5
  8. better_notion-1.1.0/better_notion/plugins/official/agents_cli.py +1767 -0
  9. better_notion-1.1.0/better_notion/plugins/official/agents_sdk/__init__.py +30 -0
  10. better_notion-1.1.0/better_notion/plugins/official/agents_sdk/managers.py +973 -0
  11. better_notion-1.1.0/better_notion/plugins/official/agents_sdk/models.py +2256 -0
  12. better_notion-1.1.0/better_notion/plugins/official/agents_sdk/plugin.py +146 -0
  13. {better_notion-1.0.0 → better_notion-1.1.0}/pyproject.toml +238 -238
  14. better_notion-1.1.0/tests/plugins/test_agents_cli.py +421 -0
  15. better_notion-1.1.0/tests/plugins/test_agents_sdk_integration.py +135 -0
  16. better_notion-1.1.0/tests/plugins/test_agents_sdk_managers.py +469 -0
  17. better_notion-1.1.0/tests/plugins/test_agents_sdk_models.py +333 -0
  18. better_notion-1.1.0/tests/sdk/__init__.py +1 -0
  19. better_notion-1.1.0/tests/sdk/test_plugin_system.py +521 -0
  20. {better_notion-1.0.0 → better_notion-1.1.0}/LICENSE +0 -0
  21. {better_notion-1.0.0 → better_notion-1.1.0}/README.md +0 -0
  22. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/__init__.py +0 -0
  23. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/__init__.py +0 -0
  24. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/client.py +0 -0
  25. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/__init__.py +0 -0
  26. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/blocks.py +0 -0
  27. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/comments.py +0 -0
  28. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/databases.py +0 -0
  29. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/pages.py +0 -0
  30. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/collections/users.py +0 -0
  31. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/__init__.py +0 -0
  32. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/block.py +0 -0
  33. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/comment.py +0 -0
  34. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/database.py +0 -0
  35. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/page.py +0 -0
  36. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/entities/user.py +0 -0
  37. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/errors.py +0 -0
  38. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/oauth.py +0 -0
  39. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/__init__.py +0 -0
  40. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/base.py +0 -0
  41. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/checkbox.py +0 -0
  42. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/date.py +0 -0
  43. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/email.py +0 -0
  44. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/number.py +0 -0
  45. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/phone.py +0 -0
  46. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/rich_text.py +0 -0
  47. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/select.py +0 -0
  48. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/title.py +0 -0
  49. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/properties/url.py +0 -0
  50. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/utils/__init__.py +0 -0
  51. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_api/utils/pagination.py +0 -0
  52. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/__init__.py +0 -0
  53. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/async_typer.py +0 -0
  54. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/__init__.py +0 -0
  55. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/auth.py +0 -0
  56. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/blocks.py +0 -0
  57. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/comments.py +0 -0
  58. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/config.py +0 -0
  59. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/databases.py +0 -0
  60. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/pages.py +0 -0
  61. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/plugins.py +0 -0
  62. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/search.py +0 -0
  63. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/update.py +0 -0
  64. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/users.py +0 -0
  65. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/commands/workspace.py +0 -0
  66. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/config.py +0 -0
  67. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/display.py +0 -0
  68. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/errors.py +0 -0
  69. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/main.py +0 -0
  70. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/markdown.py +0 -0
  71. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/response.py +0 -0
  72. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_cli/utils/__init__.py +0 -0
  73. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/__init__.py +0 -0
  74. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/base/__init__.py +0 -0
  75. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/base/entity.py +0 -0
  76. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/cache/__init__.py +0 -0
  77. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/cache/cache.py +0 -0
  78. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/__init__.py +0 -0
  79. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/block_manager.py +0 -0
  80. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/comment_manager.py +0 -0
  81. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/database_manager.py +0 -0
  82. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/page_manager.py +0 -0
  83. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/managers/user_manager.py +0 -0
  84. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/__init__.py +0 -0
  85. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/block.py +0 -0
  86. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/__init__.py +0 -0
  87. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/audio.py +0 -0
  88. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/bookmark.py +0 -0
  89. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/breadcrumb.py +0 -0
  90. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/bullet.py +0 -0
  91. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/callout.py +0 -0
  92. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/code.py +0 -0
  93. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/column.py +0 -0
  94. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/column_list.py +0 -0
  95. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/divider.py +0 -0
  96. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/embed.py +0 -0
  97. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/equation.py +0 -0
  98. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/file.py +0 -0
  99. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/heading.py +0 -0
  100. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/image.py +0 -0
  101. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/numbered.py +0 -0
  102. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/paragraph.py +0 -0
  103. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/pdf.py +0 -0
  104. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/quote.py +0 -0
  105. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/synced_block.py +0 -0
  106. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/table.py +0 -0
  107. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/table_row.py +0 -0
  108. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/template.py +0 -0
  109. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/todo.py +0 -0
  110. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/toggle.py +0 -0
  111. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/blocks/video.py +0 -0
  112. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/comment.py +0 -0
  113. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/database.py +0 -0
  114. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/page.py +0 -0
  115. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/models/user.py +0 -0
  116. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/parents/__init__.py +0 -0
  117. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/properties/__init__.py +0 -0
  118. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/properties/formula.py +0 -0
  119. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/properties/parsers.py +0 -0
  120. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/properties/relation.py +0 -0
  121. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/query/__init__.py +0 -0
  122. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/query/database_query.py +0 -0
  123. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/_sdk/query/filter_translator.py +0 -0
  124. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/__init__.py +0 -0
  125. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/official/__init__.py +0 -0
  126. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/official/productivity.py +0 -0
  127. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/plugins/state.py +0 -0
  128. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/__init__.py +0 -0
  129. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/__init__.py +0 -0
  130. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/auth.py +0 -0
  131. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/dependency_resolver.py +0 -0
  132. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/project_context.py +0 -0
  133. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/rbac.py +0 -0
  134. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/schemas.py +0 -0
  135. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/state_machine.py +0 -0
  136. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/agents/workspace.py +0 -0
  137. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/helpers.py +0 -0
  138. {better_notion-1.0.0 → better_notion-1.1.0}/better_notion/utils/retry.py +0 -0
  139. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/base/test_entity.py +0 -0
  140. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/cache/test_cache.py +0 -0
  141. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/__init__.py +0 -0
  142. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/blocks/test_advanced_blocks.py +0 -0
  143. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/test_block.py +0 -0
  144. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/test_database.py +0 -0
  145. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/test_database_bug.py +0 -0
  146. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/test_page.py +0 -0
  147. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/models/test_user.py +0 -0
  148. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/properties/test_formula.py +0 -0
  149. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/properties/test_parsers.py +0 -0
  150. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/properties/test_relation.py +0 -0
  151. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/query/test_database_query.py +0 -0
  152. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/query/test_filter_translator.py +0 -0
  153. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/test_client.py +0 -0
  154. {better_notion-1.0.0 → better_notion-1.1.0}/tests/_sdk/test_comment.py +0 -0
  155. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/__init__.py +0 -0
  156. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_auth.py +0 -0
  157. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_dependency_resolver.py +0 -0
  158. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_plugin.py +0 -0
  159. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_project_context.py +0 -0
  160. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_rbac.py +0 -0
  161. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_schemas.py +0 -0
  162. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_state_machine.py +0 -0
  163. {better_notion-1.0.0 → better_notion-1.1.0}/tests/agents/test_workspace.py +0 -0
  164. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/__init__.py +0 -0
  165. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_async_typer.py +0 -0
  166. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_config.py +0 -0
  167. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_display.py +0 -0
  168. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_errors.py +0 -0
  169. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_main.py +0 -0
  170. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_pages_commands.py +0 -0
  171. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_response.py +0 -0
  172. {better_notion-1.0.0 → better_notion-1.1.0}/tests/cli/test_update.py +0 -0
  173. {better_notion-1.0.0 → better_notion-1.1.0}/tests/conftest.py +0 -0
  174. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/conftest.py +0 -0
  175. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/test_blocks.py +0 -0
  176. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/test_databases.py +0 -0
  177. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/test_pages.py +0 -0
  178. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/test_search.py +0 -0
  179. {better_notion-1.0.0 → better_notion-1.1.0}/tests/integration/test_users.py +0 -0
  180. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/__init__.py +0 -0
  181. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_base.py +0 -0
  182. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_loader.py +0 -0
  183. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_marketplace.py +0 -0
  184. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_plugin_commands_state.py +0 -0
  185. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_productivity_plugin.py +0 -0
  186. {better_notion-1.0.0 → better_notion-1.1.0}/tests/plugins/test_state.py +0 -0
  187. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_client.py +0 -0
  188. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_collections.py +0 -0
  189. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_entities.py +0 -0
  190. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_errors.py +0 -0
  191. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_helpers.py +0 -0
  192. {better_notion-1.0.0 → better_notion-1.1.0}/tests/unit/test_properties.py +0 -0
  193. {better_notion-1.0.0 → better_notion-1.1.0}/tests/utils/test_retry.py +0 -0
@@ -1,131 +1,131 @@
1
- # Byte-compiled / optimized / DLL files
2
- __pycache__/
3
- *.py[cod]
4
- *$py.class
5
-
6
- # C extensions
7
- *.so
8
-
9
- # Distribution / packaging
10
- .Python
11
- build/
12
- develop-eggs/
13
- dist/
14
- downloads/
15
- eggs/
16
- .eggs/
17
- lib/
18
- lib64/
19
- parts/
20
- sdist/
21
- var/
22
- wheels/
23
- share/python-wheels/
24
- *.egg-info/
25
- .installed.cfg
26
- *.egg
27
- MANIFEST
28
-
29
- # PyInstaller
30
- *.manifest
31
- *.spec
32
-
33
- # Installer logs
34
- pip-log.txt
35
- pip-delete-this-directory.txt
36
-
37
- # Unit test / coverage reports
38
- htmlcov/
39
- .tox/
40
- .nox/
41
- .coverage
42
- .coverage.*
43
- .cache
44
- nosetests.xml
45
- coverage.xml
46
- *.cover
47
- *.py,cover
48
- .hypothesis/
49
- .pytest_cache/
50
- cover/
51
-
52
- # Translations
53
- *.mo
54
- *.pot
55
-
56
- # Environments
57
- .env
58
- .venv
59
- env/
60
- venv/
61
- ENV/
62
- env.bak/
63
- venv.bak/
64
-
65
- # IDEs
66
- .vscode/
67
- .idea/
68
- *.swp
69
- *.swo
70
- *~
71
- .DS_Store
72
-
73
- # mypy
74
- .mypy_cache/
75
- .dmypy.json
76
- dmypy.json
77
-
78
- # ruff
79
- .ruff_cache/
80
-
81
- # uv
82
- .uv-cache/
83
-
84
- # Jupyter Notebook
85
- .ipynb_checkpoints
86
-
87
- # pyenv
88
- .python-version
89
-
90
- # celery beat schedule file
91
- celerybeat-schedule
92
- celerybeat.pid
93
-
94
- # SageMath parsed files
95
- *.sage.py
96
-
97
- # Spyder project settings
98
- .spyderproject
99
- .spyproject
100
-
101
- # Rope project settings
102
- .ropeproject
103
-
104
- # mkdocs documentation
105
- /site
106
-
107
- # pyre static type checker
108
- .pyre/
109
-
110
- # pytype static type checker
111
- .pytype/
112
-
113
- # Cython debug symbols
114
- cython_debug/
115
-
116
- # PyCharm
117
- .idea/
118
-
119
- # macOS
120
- .DS_Store
121
-
122
- # Windows
123
- Thumbs.db
124
- ehthumbs.db
125
- Desktop.ini
126
-
127
- # Project specific
128
- *.log
129
- .env.local
130
- .env.*.local
131
- test_tokens.py
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ cover/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Environments
57
+ .env
58
+ .venv
59
+ env/
60
+ venv/
61
+ ENV/
62
+ env.bak/
63
+ venv.bak/
64
+
65
+ # IDEs
66
+ .vscode/
67
+ .idea/
68
+ *.swp
69
+ *.swo
70
+ *~
71
+ .DS_Store
72
+
73
+ # mypy
74
+ .mypy_cache/
75
+ .dmypy.json
76
+ dmypy.json
77
+
78
+ # ruff
79
+ .ruff_cache/
80
+
81
+ # uv
82
+ .uv-cache/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # celery beat schedule file
91
+ celerybeat-schedule
92
+ celerybeat.pid
93
+
94
+ # SageMath parsed files
95
+ *.sage.py
96
+
97
+ # Spyder project settings
98
+ .spyderproject
99
+ .spyproject
100
+
101
+ # Rope project settings
102
+ .ropeproject
103
+
104
+ # mkdocs documentation
105
+ /site
106
+
107
+ # pyre static type checker
108
+ .pyre/
109
+
110
+ # pytype static type checker
111
+ .pytype/
112
+
113
+ # Cython debug symbols
114
+ cython_debug/
115
+
116
+ # PyCharm
117
+ .idea/
118
+
119
+ # macOS
120
+ .DS_Store
121
+
122
+ # Windows
123
+ Thumbs.db
124
+ ehthumbs.db
125
+ Desktop.ini
126
+
127
+ # Project specific
128
+ *.log
129
+ .env.local
130
+ .env.*.local
131
+ test_tokens.py
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: better-notion
3
- Version: 1.0.0
4
- Summary: A high-level Python SDK for the Notion API with developer experience in mind. Now with AI agents workflow management system!
3
+ Version: 1.1.0
4
+ Summary: A high-level Python SDK for the Notion API with developer experience in mind.
5
5
  Project-URL: Homepage, https://github.com/nesalia-inc/better-notion
6
6
  Project-URL: Documentation, https://github.com/nesalia-inc/better-notion#readme
7
7
  Project-URL: Repository, https://github.com/nesalia-inc/better-notion
@@ -99,6 +99,11 @@ class NotionClient:
99
99
  self._comment_cache: Cache[object] = Cache()
100
100
  # No cache for Block (too many)
101
101
 
102
+ # Plugin-managed resources (for SDK plugin system)
103
+ self._plugin_caches: dict[str, Cache[object]] = {}
104
+ self._plugin_managers: dict[str, object] = {}
105
+ self._plugin_models: dict[str, type] = {}
106
+
102
107
  # Search cache
103
108
  self._search_cache: dict[str, list[object]] = {}
104
109
 
@@ -259,10 +264,92 @@ class NotionClient:
259
264
 
260
265
  return results
261
266
 
267
+ # ===== SDK PLUGIN SYSTEM =====
268
+
269
+ def register_sdk_plugin(
270
+ self,
271
+ models: dict[str, type] | None = None,
272
+ caches: dict[str, "Cache"] | None = None,
273
+ managers: dict[str, object] | None = None,
274
+ ) -> None:
275
+ """Register an SDK plugin's resources with the client.
276
+
277
+ This method allows plugins to register custom models, caches, and
278
+ managers without modifying the core SDK.
279
+
280
+ Args:
281
+ models: Dict mapping model names to model classes
282
+ caches: Dict mapping cache names to Cache instances
283
+ managers: Dict mapping manager names to manager instances
284
+
285
+ Example:
286
+ >>> client.register_sdk_plugin(
287
+ ... models={"Organization": Organization},
288
+ ... caches={"organizations": Cache()},
289
+ ... managers={"organizations": OrganizationManager(client)},
290
+ ... )
291
+ """
292
+ if models:
293
+ self._plugin_models.update(models)
294
+
295
+ if caches:
296
+ self._plugin_caches.update(caches)
297
+
298
+ if managers:
299
+ self._plugin_managers.update(managers)
300
+
301
+ def plugin_cache(self, name: str) -> "Cache | None":
302
+ """Access a plugin-registered cache.
303
+
304
+ Args:
305
+ name: Cache name (e.g., "organizations")
306
+
307
+ Returns:
308
+ Cache instance if found, None otherwise
309
+
310
+ Example:
311
+ >>> cache = client.plugin_cache("organizations")
312
+ >>> if cache and org_id in cache:
313
+ ... org = cache[org_id]
314
+ """
315
+ return self._plugin_caches.get(name)
316
+
317
+ def plugin_manager(self, name: str) -> object | None:
318
+ """Access a plugin-registered manager.
319
+
320
+ Args:
321
+ name: Manager name (e.g., "organizations")
322
+
323
+ Returns:
324
+ Manager instance if found, None otherwise
325
+
326
+ Example:
327
+ >>> orgs_mgr = client.plugin_manager("organizations")
328
+ >>> if orgs_mgr:
329
+ ... orgs = await orgs_mgr.list()
330
+ """
331
+ return self._plugin_managers.get(name)
332
+
333
+ def plugin_model(self, name: str) -> type | None:
334
+ """Access a plugin-registered model class.
335
+
336
+ Args:
337
+ name: Model name (e.g., "Organization")
338
+
339
+ Returns:
340
+ Model class if found, None otherwise
341
+
342
+ Example:
343
+ >>> OrgClass = client.plugin_model("Organization")
344
+ >>> if OrgClass:
345
+ ... org = await OrgClass.get(org_id, client=client)
346
+ """
347
+ return self._plugin_models.get(name)
348
+
262
349
  # ===== CACHE MANAGEMENT =====
263
350
 
264
351
  def clear_all_caches(self) -> None:
265
- """Clear all caches.
352
+ """Clear all caches including plugin caches.
266
353
 
267
354
  Example:
268
355
  >>> client.clear_all_caches()
@@ -272,8 +359,12 @@ class NotionClient:
272
359
  self._page_cache.clear()
273
360
  self._search_cache.clear()
274
361
 
362
+ # Clear plugin caches
363
+ for cache in self._plugin_caches.values():
364
+ cache.clear()
365
+
275
366
  def get_cache_stats(self) -> dict[str, dict[str, Any]]:
276
- """Get statistics for all caches.
367
+ """Get statistics for all caches including plugin caches.
277
368
 
278
369
  Returns:
279
370
  Dict with stats for each cache
@@ -283,10 +374,11 @@ class NotionClient:
283
374
  >>> print(stats)
284
375
  {
285
376
  'user_cache': {'hits': 100, 'misses': 5, 'size': 50, 'hit_rate': 0.95},
377
+ 'plugin:organizations': {'hits': 50, 'misses': 2, 'size': 10, 'hit_rate': 0.96},
286
378
  ...
287
379
  }
288
380
  """
289
- return {
381
+ stats = {
290
382
  "user_cache": {
291
383
  "hits": self._user_cache.stats.hits,
292
384
  "misses": self._user_cache.stats.misses,
@@ -310,6 +402,17 @@ class NotionClient:
310
402
  }
311
403
  }
312
404
 
405
+ # Add plugin cache stats
406
+ for cache_name, cache in self._plugin_caches.items():
407
+ stats[f"plugin:{cache_name}"] = {
408
+ "hits": cache.stats.hits,
409
+ "misses": cache.stats.misses,
410
+ "size": cache.stats.size,
411
+ "hit_rate": cache.stats.hit_rate
412
+ }
413
+
414
+ return stats
415
+
313
416
  # ===== CONTEXT MANAGER =====
314
417
 
315
418
  async def __aenter__(self):
@@ -0,0 +1,180 @@
1
+ """SDK Plugin System for extending NotionClient functionality.
2
+
3
+ This module provides the protocol interface for SDK-level plugins that need to:
4
+ - Register custom model classes
5
+ - Add dedicated caches to NotionClient
6
+ - Create custom managers
7
+ - Initialize plugin-specific resources
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING, Any, Protocol
13
+
14
+ if TYPE_CHECKING:
15
+ from better_notion._sdk.cache import Cache
16
+ from better_notion._sdk.client import NotionClient
17
+ from better_notion._sdk.base.entity import BaseEntity
18
+
19
+
20
+ class SDKPluginInterface(Protocol):
21
+ """
22
+ Protocol for SDK-level plugins that extend NotionClient functionality.
23
+
24
+ SDK plugins can register custom models, caches, and managers with the
25
+ NotionClient, enabling domain-specific extensions without modifying
26
+ the core SDK.
27
+
28
+ Example:
29
+ >>> class AgentsSDKPlugin:
30
+ ... def register_models(self) -> dict[str, type[BaseEntity]]:
31
+ ... return {"Organization": Organization}
32
+ ...
33
+ ... def register_caches(self, client: NotionClient) -> dict[str, Cache]:
34
+ ... return {"organizations": Cache()}
35
+ ...
36
+ ... def register_managers(self, client: NotionClient) -> dict[str, Any]:
37
+ ... return {"organizations": OrganizationManager(client)}
38
+ """
39
+
40
+ def register_models(self) -> dict[str, type[BaseEntity]]:
41
+ """Register custom model classes.
42
+
43
+ Model classes should inherit from BaseEntity and follow the
44
+ autonomous entity pattern (get, create, update methods).
45
+
46
+ Returns:
47
+ Dictionary mapping model names to model classes
48
+
49
+ Example:
50
+ >>> def register_models(self) -> dict[str, type[BaseEntity]]:
51
+ ... return {
52
+ ... "Organization": Organization,
53
+ ... "Project": Project,
54
+ ... "Task": Task,
55
+ ... }
56
+ """
57
+ ...
58
+
59
+ def register_caches(self, client: "NotionClient") -> dict[str, "Cache"]:
60
+ """Register custom caches with the client.
61
+
62
+ Caches are stored in the client and accessible via
63
+ client.plugin_cache(name). Each cache should have a unique name
64
+ to avoid collisions with other plugins.
65
+
66
+ Args:
67
+ client: NotionClient instance to register caches with
68
+
69
+ Returns:
70
+ Dictionary mapping cache names to Cache instances
71
+
72
+ Example:
73
+ >>> def register_caches(self, client) -> dict[str, Cache]:
74
+ ... return {
75
+ ... "organizations": Cache(),
76
+ ... "projects": Cache(),
77
+ ... "tasks": Cache(),
78
+ ... }
79
+ """
80
+ ...
81
+
82
+ def register_managers(self, client: "NotionClient") -> dict[str, Any]:
83
+ """Register custom managers with the client.
84
+
85
+ Managers are accessible via client.plugin_manager(name).
86
+ They typically provide convenience methods for working with
87
+ the plugin's models.
88
+
89
+ Args:
90
+ client: NotionClient instance
91
+
92
+ Returns:
93
+ Dictionary mapping manager names to manager instances
94
+
95
+ Example:
96
+ >>> def register_managers(self, client) -> dict[str, Any]:
97
+ ... return {
98
+ ... "organizations": OrganizationManager(client),
99
+ ... "projects": ProjectManager(client),
100
+ ... }
101
+ """
102
+ ...
103
+
104
+ def initialize(self, client: "NotionClient") -> None:
105
+ """Initialize plugin-specific resources.
106
+
107
+ Called after all registrations (models, caches, managers) are
108
+ complete. Use this for setup tasks like loading configuration,
109
+ validating resources, or establishing connections.
110
+
111
+ Args:
112
+ client: NotionClient instance
113
+
114
+ Example:
115
+ >>> def initialize(self, client) -> None:
116
+ ... # Load database IDs from config
117
+ ... db_ids = load_workspace_config()
118
+ ... client._workspace_config = db_ids
119
+ """
120
+ ...
121
+
122
+ def get_info(self) -> dict[str, Any]:
123
+ """Return plugin metadata.
124
+
125
+ Returns:
126
+ Dictionary with plugin information
127
+
128
+ Example:
129
+ >>> def get_info(self) -> dict[str, Any]:
130
+ ... return {
131
+ ... "name": "agents-sdk",
132
+ ... "version": "1.0.0",
133
+ ... "description": "SDK extensions for agents workflow",
134
+ ... }
135
+ """
136
+ ...
137
+
138
+
139
+ class CombinedPluginInterface(Protocol):
140
+ """
141
+ Protocol for plugins that extend both CLI and SDK.
142
+
143
+ This allows a single plugin class to provide:
144
+ - CLI commands (via register_commands)
145
+ - SDK extensions (via register_models, register_caches, etc.)
146
+
147
+ Example:
148
+ >>> class AgentsPlugin(CombinedPluginInterface):
149
+ ... def register_commands(self, app: typer.Typer) -> None:
150
+ ... # Register CLI commands
151
+ ... pass
152
+ ...
153
+ ... def register_models(self) -> dict[str, type[BaseEntity]]:
154
+ ... # Register SDK models
155
+ ... return {"Organization": Organization}
156
+ """
157
+
158
+ def register_commands(self, app: Any) -> None:
159
+ """Register CLI commands with Typer app."""
160
+ ...
161
+
162
+ def register_models(self) -> dict[str, type[BaseEntity]]:
163
+ """Register custom model classes."""
164
+ ...
165
+
166
+ def register_caches(self, client: "NotionClient") -> dict[str, "Cache"]:
167
+ """Register custom caches."""
168
+ ...
169
+
170
+ def register_managers(self, client: "NotionClient") -> dict[str, Any]:
171
+ """Register custom managers."""
172
+ ...
173
+
174
+ def initialize(self, client: "NotionClient") -> None:
175
+ """Initialize plugin resources."""
176
+ ...
177
+
178
+ def get_info(self) -> dict[str, Any]:
179
+ """Return plugin metadata."""
180
+ ...