notionary 0.2.6__py3-none-any.whl → 0.2.8__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.
@@ -1,6 +1,6 @@
1
1
  notionary/__init__.py,sha256=hPvZ-iqt5R_dAs9KaRBhC5eXzuQ5uvt-9EaU2O_7bZw,691
2
2
  notionary/notion_client.py,sha256=O-lvy2-jMNSDc_8cWKuGVfckCdc1_PiQOlfxQKjQ6_A,7325
3
- notionary/database/database_discovery.py,sha256=qDGFhXG9s-_6CXdRg8tMiwX4dvX7jLjgAUFPSNlYtlI,4506
3
+ notionary/database/database_discovery.py,sha256=Ebn-9HuNb8fwqf9KP4Vyys8t5zCKUOqBACS_-mohkbk,4498
4
4
  notionary/database/notion_database.py,sha256=zbHPejETr101pprd7kewZ555d_TONN_wJi7b9Eyfoyg,7634
5
5
  notionary/database/notion_database_factory.py,sha256=FmijGYz6A4mCWVionOg9sxgFXfb9he52xdgNswJw24k,6584
6
6
  notionary/database/models/page_result.py,sha256=Vmm5_oYpYAkIIJVoTd1ZZGloeC3cmFLMYP255mAmtaw,233
@@ -8,10 +8,11 @@ notionary/elements/audio_element.py,sha256=7bEpFl9jA6S1UZlEXsmFzEUVoViEp1o_7zZIC
8
8
  notionary/elements/bookmark_element.py,sha256=msCtZvuPkIj1kiShNwE8i1GDYwamFb5mwRyZm4XyVY4,8145
9
9
  notionary/elements/bulleted_list_element.py,sha256=obsb3JqUNET3uS5OZM3yzDqxSzJzUuEob-Fzx0UIg9Y,2664
10
10
  notionary/elements/callout_element.py,sha256=ZsRvRtVy9kxdTwgrB5JGjZ4qcCiwcC0WimWJ_cW0aLY,4492
11
- notionary/elements/code_block_element.py,sha256=Zy5l8bsX2R1QBgmCZDM_tkxzSXylHABshKY8r0kNBBo,5853
12
- notionary/elements/divider_element.py,sha256=0e10YK-CC8uGuL7921dEIjeJK9ha-WhRIYRf2fFuxVQ,2211
11
+ notionary/elements/code_block_element.py,sha256=YHOiV2eQIe7gbsOnrsQnztomTZ-eP3HRHsonzrj3Tt8,7529
12
+ notionary/elements/column_element.py,sha256=pUgu0e2vptvti2Mms_jcivSX0VmeBY9B1asCrVnXrxc,12476
13
+ notionary/elements/divider_element.py,sha256=h6lzk4HITuBwHzxQU967QCWL4F8j2GfEOloWnZ8xs8E,2332
13
14
  notionary/elements/embed_element.py,sha256=Zcc18Kl8SGoG98P2aYE0TkBviRvSz-sYOdjMEs-tvgk,4579
14
- notionary/elements/heading_element.py,sha256=kqgjyfaawEODir2tzDyf7-7wm38DbqoZnsH5k94GsA0,3013
15
+ notionary/elements/heading_element.py,sha256=4X8LLhUb2oyfErQ5p-r0bq3wSR6TGSTSQjoVAhVnTO4,3166
15
16
  notionary/elements/image_element.py,sha256=cwdovaWK8e4uZJU97l_fJ2etAxAgM2rG2EE34t4eag8,4758
16
17
  notionary/elements/mention_element.py,sha256=L4t6eAY3RcbOqIiwVT_CAqwatDtP4tBs9FaqRhaCbpQ,8227
17
18
  notionary/elements/notion_block_element.py,sha256=BVrZH09vyojuacs3KGReVx3W0Ee6di_5o9E8N5sex28,1258
@@ -24,20 +25,20 @@ notionary/elements/todo_element.py,sha256=ND3oOzSnd0l1AUGTcG2NiHW50ZbI4-atjtNorL
24
25
  notionary/elements/toggle_element.py,sha256=h9vYkkAIUHzn-0mu31qC6UPdlk_0EFIsU5A4T_A2ZI8,11082
25
26
  notionary/elements/toggleable_heading_element.py,sha256=XdaPsd8anufwAACL8J-Egd_RcqPqZ1gFlzeol1GOyyc,9960
26
27
  notionary/elements/video_element.py,sha256=y0OmOYXdQBc2rSYAHRmA4l4rzNqPnyhuXbEipcgzQgY,5727
27
- notionary/elements/registry/block_registry.py,sha256=giWGcdgc3Z60wvfUr-FS6UMc-k-Q6DlXO8T0gl4fVC8,5027
28
- notionary/elements/registry/block_registry_builder.py,sha256=Wnob3PbgzVAoXBW0Eon1KzX4aD4d36KeaDe_uYIKFnU,9311
28
+ notionary/elements/registry/block_registry.py,sha256=g0id_Q6guzTyNY6HfnB9AjOBvCR4CvtpnUeFAY8kgY0,5027
29
+ notionary/elements/registry/block_registry_builder.py,sha256=5zRKnw2102rAeHpANs6Csu4DVufOazf1peEovChWcgs,9572
29
30
  notionary/exceptions/database_exceptions.py,sha256=I-Tx6bYRLpi5pjGPtbT-Mqxvz3BFgYTiuZxknJeLxtI,2638
30
31
  notionary/exceptions/page_creation_exception.py,sha256=4v7IuZD6GsQLrqhDLriGjuG3ML638gAO53zDCrLePuU,281
31
32
  notionary/models/notion_block_response.py,sha256=gzL4C6K9QPcaMS6NbAZaRceSEnMbNwYBVVzxysza5VU,6002
32
33
  notionary/models/notion_database_response.py,sha256=FMAasQP20S12J_KMdMlNpcHHwxFKX2YtbE4Q9xn-ruQ,1213
33
34
  notionary/models/notion_page_response.py,sha256=r4fwMwwDocj92JdbSmyrzIqBKsnEaz4aDUiPabrg9BM,1762
34
- notionary/page/markdown_to_notion_converter.py,sha256=EuqUGNv2HZu67INOnGheeJkt7WHTWGuLnhEG72_Wv5Y,15833
35
+ notionary/page/markdown_to_notion_converter.py,sha256=-IC2yJimrmJ7e5EorV-48V6V12n1VBmsOHKejZxAKCo,20909
35
36
  notionary/page/notion_page.py,sha256=NDxAJaNk4tlKUrenhKBdnuvjlVgnxC0Z6fprf2LyNeE,18046
36
37
  notionary/page/notion_page_factory.py,sha256=2A3M5Ub_kV2-q7PPRqDgfwBjhkGCwtL5i3Kr2RfvvVo,7213
37
38
  notionary/page/notion_to_markdown_converter.py,sha256=vUQss0J7LUFLULGvW27PjaTFuWi8OsRQAUBowSYorkM,6408
38
39
  notionary/page/content/notion_page_content_chunker.py,sha256=xRks74Dqec-De6-AVTxMPnXs-MSJBzSm1HfJfaHiKr8,3330
39
40
  notionary/page/content/page_content_retriever.py,sha256=f8IU1CIfSTTT07m72-vgpUr_VOCsisqqFHQ1JeOhb3g,2222
40
- notionary/page/content/page_content_writer.py,sha256=czBzNCGcwdpqNLSQPyna1s8Y7pjyPzDgJC3UUK5PLGA,3793
41
+ notionary/page/content/page_content_writer.py,sha256=LOn70vFLOzPoCP2vqH922eNEh96B3cNiBuI3eDy8yLA,7439
41
42
  notionary/page/metadata/metadata_editor.py,sha256=HI7m8Zn_Lz6x36rBnW1EnbicVS-4Q8NmCJYKN-OlY-c,5130
42
43
  notionary/page/metadata/notion_icon_manager.py,sha256=6a9GS5sT0trfuAb0hlF2Cw_Wc1oM59a1QA4kO9asvMA,2576
43
44
  notionary/page/metadata/notion_page_cover_manager.py,sha256=gHQSA8EtO4gbkMt_C3nKc0DF44SY_4ycd57cJSihdqk,2215
@@ -49,12 +50,12 @@ notionary/page/relations/notion_page_relation_manager.py,sha256=tfkvLHClaYel_uEa
49
50
  notionary/page/relations/notion_page_title_resolver.py,sha256=dIjiEeHjjNT-DrIhz1nynkfHkMpUuJJFOEjb25Wy7f4,3575
50
51
  notionary/page/relations/page_database_relation.py,sha256=8lEp8fQjPwjWhA8nZu3k8mW6EEc54ki1Uwf4iUV1DOU,2245
51
52
  notionary/prompting/element_prompt_content.py,sha256=tHref-SKA81Ua_IQD2Km7y7BvFtHl74haSIjHNYE3FE,4403
52
- notionary/prompting/markdown_syntax_prompt_generator.py,sha256=0hD2DZDDjQ3ZKHPvZnDKpUs6Puq5O_E2IGW1te1R6v4,4751
53
+ notionary/prompting/markdown_syntax_prompt_generator.py,sha256=_1qIYlqSfI6q6Fut10t6gGwTQuS8c3QBcC_5DBme9Mo,5084
53
54
  notionary/util/logging_mixin.py,sha256=b6wHj0IoVSWXbHh0yynfJlwvIR33G2qmaGNzrqyb7Gs,1825
54
55
  notionary/util/page_id_utils.py,sha256=EYNMxgf-7ghzL5K8lKZBZfW7g5CsdY0Xuj4IYmU8RPk,1381
55
56
  notionary/util/warn_direct_constructor_usage.py,sha256=vyJR73F95XVSRWIbyij-82IGOpAne9SBPM25eDpZfSU,1715
56
- notionary-0.2.6.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
57
- notionary-0.2.6.dist-info/METADATA,sha256=9_QkhSrN2ndPn6BjDjWeIUMUEGXFbObEG4gxsfHYOBI,8374
58
- notionary-0.2.6.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
59
- notionary-0.2.6.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
60
- notionary-0.2.6.dist-info/RECORD,,
57
+ notionary-0.2.8.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
58
+ notionary-0.2.8.dist-info/METADATA,sha256=RtbtcBYg8U9oqX64Tl2VD79bf199uwLZEqVD9QQ2jio,7521
59
+ notionary-0.2.8.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
60
+ notionary-0.2.8.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
61
+ notionary-0.2.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,256 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: notionary
3
- Version: 0.2.6
4
- Summary: A toolkit to convert between Markdown and Notion blocks
5
- Home-page: https://github.com/mathisarends/notionary
6
- Author: Mathis Arends
7
- Author-email: mathisarends27@gmail.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Requires-Python: >=3.7
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: httpx>=0.28.0
14
- Requires-Dist: python-dotenv>=1.1.0
15
- Requires-Dist: pydantic>=2.11.4
16
- Dynamic: author
17
- Dynamic: author-email
18
- Dynamic: classifier
19
- Dynamic: description
20
- Dynamic: description-content-type
21
- Dynamic: home-page
22
- Dynamic: license-file
23
- Dynamic: requires-dist
24
- Dynamic: requires-python
25
- Dynamic: summary
26
-
27
- # Notionary 📝
28
-
29
- [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
30
- [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
31
-
32
- **Notionary** is a powerful Python library for interacting with the Notion API, making it easy to create, update, and manage Notion pages and databases programmatically with a clean, intuitive interface. It's specifically designed to be the foundation for AI-driven Notion content generation.
33
-
34
- ## Features
35
-
36
- - **Rich Markdown Support**: Create Notion pages using intuitive Markdown syntax with custom extensions
37
- - **Dynamic Database Operations**: Create, update, and query database entries with schema auto-detection
38
- - **Extensible Block Registry**: Add, customize, or remove Notion block elements with a flexible registry pattern
39
- - **LLM-Ready Prompts**: Generate system prompts explaining Markdown syntax for LLMs to create Notion content
40
- - **Async-First Design**: Built for modern Python with full async/await support
41
- - **Schema-Based Validation**: Automatic property validation based on database schemas
42
- - **Intelligent Content Conversion**: Bidirectional conversion between Markdown and Notion blocks
43
-
44
- ## Installation
45
-
46
- ```bash
47
- pip install notionary
48
- ```
49
-
50
- ## Custom Markdown Syntax
51
-
52
- Notionary extends standard Markdown with special syntax to support Notion-specific features:
53
-
54
- ### Text Formatting
55
-
56
- - Standard Markdown: `**bold**`, `*italic*`, `~~strikethrough~~`, `` `code` ``
57
- - Highlights: `==highlighted text==`, `==red:warning==`, `==blue:note==`
58
-
59
- ### Block Elements
60
-
61
- #### Callouts
62
-
63
- ```markdown
64
- !> [💡] This is a default callout with the light bulb emoji
65
- !> [🔔] This is a callout with a bell emoji
66
- !> {blue_background} [💧] This is a blue callout with a water drop emoji
67
- !> {yellow_background} [⚠️] Warning: This is an important note
68
- ```
69
-
70
- #### Toggles
71
-
72
- ```markdown
73
- +++ How to use NotionPageManager
74
-
75
- 1. Initialize with NotionPageManager
76
- 2. Update metadata with set_title(), set_page_icon(), etc.
77
- 3. Add content with replace_content() or append_markdown()
78
- ```
79
-
80
- #### Bookmarks
81
-
82
- ```markdown
83
- [bookmark](https://notion.so "Notion Homepage" "Your connected workspace")
84
- ```
85
-
86
- #### Multi-Column Layouts
87
-
88
- ```markdown
89
- ::: columns
90
- ::: column
91
- Content for first column
92
- :::
93
- ::: column
94
- Content for second column
95
- :::
96
- :::
97
- ```
98
-
99
- And more:
100
-
101
- - Tables with standard Markdown syntax
102
- - Code blocks with syntax highlighting
103
- - To-do lists with `- [ ]` and `- [x]`
104
- - Block quotes with `>`
105
-
106
- ## Database Management
107
-
108
- Notionary makes it easy to work with Notion databases, automatically handling schema detection and property conversion:
109
-
110
- ```python
111
- import asyncio
112
- from notionary import NotionDatabaseFactory
113
-
114
- async def main():
115
- # Find database by name with fuzzy matching
116
- db_manager = await NotionDatabaseFactory.from_database_name("Projects")
117
-
118
- # Create a new page with properties
119
- properties = {
120
- "Title": "Created via Notionary",
121
- "Status": "In Progress",
122
- "Priority": "High"
123
- }
124
-
125
- page = await db_manager.create_blank_page()
126
-
127
- # Set page content with rich Markdown
128
- await page.set_title("My New Project")
129
- await page.set_page_icon(emoji="🚀")
130
-
131
- markdown = """
132
- # Project Overview
133
-
134
- !> [💡] This page was created programmatically using Notionary.
135
-
136
- ## Tasks
137
- - [ ] Define project scope
138
- - [ ] Create timeline
139
- - [ ] Assign resources
140
-
141
- +++ Implementation Details
142
- This project will use our standard architecture with custom extensions.
143
- """
144
-
145
- await page.replace_content(markdown)
146
-
147
- if __name__ == "__main__":
148
- asyncio.run(main())
149
- ```
150
-
151
- ## Page Content Management
152
-
153
- Create rich Notion pages using enhanced Markdown:
154
-
155
- ```python
156
- from notionary import NotionPage
157
-
158
- async def create_rich_page():
159
- url = "https://www.notion.so/Your-Page-1cd389d57bd381e58be9d35ce24adf3d"
160
- page_manager = NotionPage(url=url)
161
-
162
- await page_manager.set_title("Notionary Demo")
163
- await page_manager.set_page_icon(emoji="✨")
164
- await page_manager.set_page_cover("https://images.unsplash.com/photo-1555066931-4365d14bab8c")
165
-
166
- markdown = '''
167
- # Notionary Rich Content Demo
168
-
169
- !> [💡] This page was created with Notionary's custom Markdown syntax.
170
-
171
- ## Features
172
- - Easy-to-use Python API
173
- - **Rich** Markdown support
174
- - Async functionality
175
-
176
- +++ Implementation Details
177
- Notionary uses a custom converter to transform Markdown into Notion blocks.
178
- This makes it easy to create rich content programmatically.
179
- '''
180
-
181
- await page_manager.replace_content(markdown)
182
- ```
183
-
184
- ## Block Registry & Builder
185
-
186
- Notionary uses a flexible registry pattern with a builder to customize which Notion elements are supported, allowing programmatic creation of complex UI layouts that were previously only possible through Notion's UI:
187
-
188
- ```python
189
- from notionary import NotionPage
190
- from notionary.elements.block_element_registry_builder import BlockElementRegistryBuilder
191
-
192
- # Create a registry with standard Notion elements
193
- registry = BlockElementRegistryBuilder.create_full_registry()
194
-
195
- # Or build a custom registry with only the elements you need
196
- custom_registry = (
197
- BlockElementRegistryBuilder()
198
- .with_headings()
199
- .with_callouts()
200
- .with_toggles()
201
- .with_lists()
202
- .with_tables()
203
- .with_paragraphs()
204
- .build()
205
- )
206
-
207
- # Apply this registry to a page to enable custom Markdown support
208
- page = NotionPage(url="https://www.notion.so/your-page-url")
209
- page.block_registry = custom_registry
210
-
211
- # Now your page supports exactly the elements you've defined
212
- await page.replace_content("# Custom heading with only selected elements")
213
- ```
214
-
215
- This registry approach gives you granular control over which Notion UI elements can be created through Markdown, making it possible to programmatically construct any page layout that would normally require manual UI interaction.
216
-
217
- ## AI-Ready LLM Prompt Generation
218
-
219
- Notionary can automatically generate comprehensive system prompts for LLMs to understand Notion's custom Markdown syntax:
220
-
221
- ```python
222
- from notionary.elements.block_element_registry_builder import BlockElementRegistryBuilder
223
-
224
- registry = BlockElementRegistryBuilder.create_full_registry()
225
- llm_system_prompt = registry.generate_llm_prompt()
226
-
227
- # Use this prompt with your LLM to generate Notion-compatible Markdown
228
- print(llm_system_prompt)
229
- ```
230
-
231
- This makes Notionary the perfect foundation for AI-driven Notion content generation, enabling LLMs to create properly formatted Notion pages.
232
-
233
- ## Examples
234
-
235
- See the [examples folder](examples/) for more comprehensive demonstrations:
236
-
237
- - [Database discovery and querying](examples/database_discovery_example.py)
238
- - [Rich page creation with Markdown](examples/page_example.py)
239
- - [Database factory usage](examples/database_factory_example.py)
240
- - [Page lookup and access](examples/page_factory_by_url_example.py)
241
- - [Iterating through database entries](examples/iter_database_example.py)
242
-
243
- ## Perfect for AI Agents and Automation
244
-
245
- - **LLM Integration**: Generate Notion-compatible content with LLMs using the system prompt generator
246
- - **Dynamic Content Generation**: AI agents can generate content in Markdown and render it as Notion pages
247
- - **Schema-Aware Operations**: Automatically validate and format properties
248
- - **Simplified API**: Easier integration with AI workflows
249
-
250
- ## License
251
-
252
- MIT
253
-
254
- ## Contributing
255
-
256
- Contributions welcome — feel free to submit a pull request!