notionary 0.2.14__py3-none-any.whl → 0.2.16__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.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.3
2
+ Name: notionary
3
+ Version: 0.2.16
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: httpx (>=0.28.0)
17
+ Requires-Dist: posthog (>=6.3.1,<7.0.0)
18
+ Requires-Dist: pydantic (>=2.11.4)
19
+ Requires-Dist: python-dotenv (>=1.1.0)
20
+ Project-URL: Homepage, https://github.com/mathisarends/notionary
21
+ Description-Content-Type: text/markdown
22
+
23
+ <picture>
24
+ <source media="(prefers-color-scheme: dark)" srcset="./static/notionary-dark.png">
25
+ <source media="(prefers-color-scheme: light)" srcset="./static/notionary-light.png">
26
+ <img alt="Notionary logo: dark mode shows a white logo, light mode shows a black logo." src="./static/browser-use.png" width="full">
27
+ </picture>
28
+
29
+ <h1 align="center">Notion API simplified for Python developers 🐍</h1>
30
+
31
+ [![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/downloads/)
32
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
33
+
34
+ - **Object-Oriented Design**: Clean, intuitive classes for Pages, Databases, and Workspaces with full CRUD operations
35
+ - **Rich Markdown to Notion**: Convert extended Markdown (callouts, toggles, columns) directly into beautiful Notion blocks
36
+ - **Smart Discovery**: Find pages and databases by name with fuzzy matching - no more hunting for URLs
37
+ - **Async-First Architecture**: Built for modern Python with full async/await support and high performance
38
+ - **AI-Ready Integration**: Generate LLM system prompts and let AI agents create Notion content seamlessly
39
+
40
+ ---
41
+
42
+ # Quick start
43
+ ```bash
44
+ pip install notionary
45
+ ```
46
+
47
+ - Set up your Notion integration (notion.so/profile/integrations)
48
+ - Add your integration key in your `.env` file.
49
+
50
+ ```bash
51
+ NOTION_SECRET=YOUR_INTEGRATION_KEY
52
+ ```
53
+
54
+ ### Creating and Managing Pages 🚀
55
+ ```python
56
+ from notionary import NotionPage
57
+
58
+ async def main():
59
+ # Simpy find an existing page by its title
60
+ page = await NotionPage.from_page_name("My Test Page")
61
+
62
+ # Add rich content with custom Markdown
63
+ content = """
64
+ # 🚀 Generated with Notionary
65
+
66
+ !> [💡] This page was created programmatically!
67
+
68
+ ## Features
69
+ - **Rich** Markdown support
70
+ - Database integration
71
+ - AI-ready content generation
72
+
73
+ +++ Click to see more details
74
+ | Notionary makes it easy to create beautiful Notion pages
75
+ | directly from Python code with intuitive Markdown syntax.
76
+ """
77
+
78
+ await page.replace_content(content)
79
+ print(f"✅ Page updated: {page.url}")
80
+
81
+ asyncio.run(main())
82
+ ```
83
+
84
+ ---
85
+
86
+ ### Working with Databases 🔥
87
+
88
+ ```python
89
+ import asyncio
90
+ from notionary import NotionDatabase
91
+
92
+ async def main():
93
+ # Connect to database by name (fuzzy matching)
94
+ db = await NotionDatabase.from_database_name("Projects")
95
+
96
+ # Create a new page with properties
97
+ page = await db.create_blank_page()
98
+ await page.set_title("🆕 New Project Entry")
99
+ await page.set_property_value_by_name("Status", "In Progress")
100
+ await page.set_property_value_by_name("Priority", "High")
101
+
102
+ # find pages created in the last 7 days
103
+ count = 0
104
+ async for page in db.iter_pages_with_filter(
105
+ db.create_filter().with_created_last_n_days(7)
106
+ ):
107
+ count += 1
108
+ print(f"{count:2d}. {page.emoji_icon or '📄'} {page.title}")
109
+
110
+ asyncio.run(main())
111
+ ```
112
+
113
+ ## Custom Markdown Syntax
114
+
115
+ Notionary extends standard Markdown with special syntax to support Notion-specific features:
116
+
117
+ ### Text Formatting
118
+
119
+ - Standard: `**bold**`, `*italic*`, `~~strikethrough~~`, `` `code` ``
120
+ - Links: `[text](url)`
121
+ - Quotes: `> This is a quote`
122
+ - Divider: `---`
123
+
124
+ ### Callouts
125
+
126
+ ```markdown
127
+ !> [💡] This is a default callout with the light bulb emoji
128
+ !> [🔔] This is a notification with a bell emoji
129
+ !> [⚠️] Warning: This is an important note
130
+ ```
131
+
132
+ ### Toggles
133
+
134
+ ```markdown
135
+ +++ How to use Notionary
136
+ | 1. Initialize with NotionPage
137
+ | 2. Update metadata with set_title(), set_emoji_icon(), etc.
138
+ | 3. Add content with replace_content() or append_markdown()
139
+ ```
140
+
141
+ ### Multi-Column Layout
142
+
143
+ ```markdown
144
+ ::: columns
145
+ ::: column
146
+
147
+ ## Left Column
148
+
149
+ - Item 1
150
+ - Item 2
151
+ - Item 3
152
+ :::
153
+ ::: column
154
+
155
+ ## Right Column
156
+
157
+ This text appears in the second column. Multi-column layouts are perfect for:
158
+
159
+ - Comparing features
160
+ - Creating side-by-side content
161
+ - Improving readability of wide content
162
+ :::
163
+ :::
164
+ ```
165
+
166
+ ### Code Blocks
167
+
168
+ ```python
169
+ def hello_world():
170
+ print("Hello from Notionary!")
171
+ ```
172
+
173
+ ### To-do Lists
174
+
175
+ ```markdown
176
+ - [ ] Define project scope
177
+ - [x] Create timeline
178
+ - [ ] Assign resources
179
+ ```
180
+
181
+ ### Tables
182
+
183
+ ```markdown
184
+ | Feature | Status | Priority |
185
+ | --------------- | ----------- | -------- |
186
+ | API Integration | Complete | High |
187
+ | Documentation | In Progress | Medium |
188
+ ```
189
+
190
+ ### More Elements
191
+
192
+ ```markdown
193
+ ![Caption](https://example.com/image.jpg)
194
+ @[Caption](https://youtube.com/watch?v=...)
195
+ [bookmark](https://example.com "Title" "Description")
196
+ ```
197
+
198
+ ## Examples
199
+
200
+ Explore the `examples/` directory for comprehensive guides:
201
+
202
+ ### 🚀 Core Examples
203
+ - [**Page Management**](examples/page_example.py) - Create, update, and manage Notion pages
204
+ - [**Page Operations**](examples/page.py) - Advanced page manipulation and content handling
205
+ - [**Database Operations**](examples/database.py) - Connect to and manage Notion databases
206
+ - [**Database Iteration**](examples/database_iteration.py) - Query and filter database entries
207
+ - [**Workspace Discovery**](examples/workspace_discovery.py) - Explore and discover your Notion workspace
208
+
209
+ ### 📝 Markdown Examples
210
+ - [**Basic Formatting**](examples/markdown/basic.py) - Text formatting, lists, and basic elements
211
+ - [**Callouts**](examples/markdown/callout.py) - Create beautiful callout blocks with icons
212
+ - [**Toggles**](examples/markdown/toggle.py) - Collapsible content sections
213
+ - [**Multi-Column Layouts**](examples/markdown/columns.py) - Side-by-side content arrangement
214
+ - [**Code Blocks**](examples/markdown/code.py) - Syntax-highlighted code examples
215
+ - [**Tables**](examples/markdown/table.py) - Structured data presentation
216
+ - [**Media Embeds**](examples/markdown/embed.py) - Images, videos, and rich media
217
+ - [**Audio Content**](examples/markdown/audio.py) - Audio file integration
218
+
219
+ Each example is self-contained and demonstrates specific features with practical use cases.
220
+
221
+ ## Contributing
222
+
223
+ Contributions welcome — feel free to submit a pull request!
224
+
@@ -1,6 +1,5 @@
1
1
  notionary/__init__.py,sha256=4eO6Jx57VRR_Ejo9w7IJeET8SZOvxFl_1lOB39o39No,250
2
- notionary/base_notion_client.py,sha256=bqQu9uEdDmZhMAGGv6e_B8mBLOAWLWjoP8s9L6UaQks,6714
3
- notionary/workspace.py,sha256=kW9fbVUSECivlvABBwnks2nALfk09V6g6Oc2Eq_pK5U,2511
2
+ notionary/base_notion_client.py,sha256=hJnN8CZe7CUunMBljGdKKN44xMlJQAIAhQyT-3WEIK8,6722
4
3
  notionary/blocks/__init__.py,sha256=MFBxK3zZ28tV_u8XT20Q6HY39KENCfJDfDflLTYVt4E,2019
5
4
  notionary/blocks/audio_element.py,sha256=rQbWz8akbobci8CFvnFuuHoDNJCG7mcuSXdB8hHjqLU,5355
6
5
  notionary/blocks/bookmark_element.py,sha256=gW6uKCkuWFpHEzq-g1CbvKvma6hyTMUH2XMczI0U-5M,8080
@@ -17,27 +16,25 @@ notionary/blocks/notion_block_client.py,sha256=mLkJ9mbfTZB7oml2hjXxxmr9XUCfM3u_8
17
16
  notionary/blocks/notion_block_element.py,sha256=r27KYICQvdmOg3AyzHE6ouWjX8WuJmX1bERCgkBdaGE,1263
18
17
  notionary/blocks/numbered_list_element.py,sha256=BL_mui9vJ0usOFbRrNZRP_IY8QLG3vGFRYiPPsq_OJw,2596
19
18
  notionary/blocks/paragraph_element.py,sha256=-zCwJOanOVjv07DRArD13yRYaxfL8sCob6oN3PKvzNc,3188
19
+ notionary/blocks/prompts/element_prompt_builder.py,sha256=rYMKPmpEFyk26JFZlwcTzMHATpvHnn4Dn284vewFog0,2953
20
+ notionary/blocks/prompts/element_prompt_content.py,sha256=ItnhGwKsHGnnY9E_LGgZZeTCT9ZfnkJY8xad4wFViWk,1567
20
21
  notionary/blocks/qoute_element.py,sha256=pkeT6N7PZrepIod8WLrY1DMe2DW6fM98Y4zXiiACenw,6059
22
+ notionary/blocks/registry/block_registry.py,sha256=fEKe03bJYkzy19cbkeO2d30nvSThG6TWHXHxf_-aUbg,4961
23
+ notionary/blocks/registry/block_registry_builder.py,sha256=FA_0WOajaeVaqdphNh8EyN0p_7ItzFqEufYa6YVBLeY,8731
21
24
  notionary/blocks/table_element.py,sha256=DzXbSVm3KwTfnLF2cp765gj-VC50zWvj_0RU_WcQDJw,11184
22
25
  notionary/blocks/text_inline_formatter.py,sha256=aKnaR1LvmbBkRdJVId8xtMkrbw1xaw6e4ZLUH97XLfU,8583
23
26
  notionary/blocks/todo_element.py,sha256=6ndhgGJNiy7eb-Ll--Va7zEqQySxFAFYpzY4PWJbGUQ,4059
24
27
  notionary/blocks/toggle_element.py,sha256=2gofKL4ndVkRxkuH-iYVx0YFUc649gpQQbZtwh2BpY8,11017
25
28
  notionary/blocks/toggleable_heading_element.py,sha256=fkXvKtgCg6PuHqrHq7LupmqzpasJ1IyVf2RBLYTiVIo,9893
26
29
  notionary/blocks/video_element.py,sha256=C19XxFRyAUEbhhC9xvhAAGN8YBYP6ON1vm_x7b_gUrY,5664
27
- notionary/blocks/prompts/element_prompt_builder.py,sha256=rYMKPmpEFyk26JFZlwcTzMHATpvHnn4Dn284vewFog0,2953
28
- notionary/blocks/prompts/element_prompt_content.py,sha256=ItnhGwKsHGnnY9E_LGgZZeTCT9ZfnkJY8xad4wFViWk,1567
29
- notionary/blocks/registry/block_registry.py,sha256=hEBa8PdFn1CeevFBqKbcFX7yuBjulwGASUMKoHRsm9s,4305
30
- notionary/blocks/registry/block_registry_builder.py,sha256=FA_0WOajaeVaqdphNh8EyN0p_7ItzFqEufYa6YVBLeY,8731
31
- notionary/cli/main.py,sha256=-rQoDGvDrFIOvoWzJIIrXQQz4H12D3TkwdNdEF9SEGQ,12883
32
- notionary/cli/onboarding.py,sha256=KQornxGBxsyXa0PfVqt4KPq-3B3Ry1sLd5DB3boAB04,3350
33
30
  notionary/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
31
  notionary/database/client.py,sha256=ZcfydeYlpgGJt6wV1ib33KeXUiL-cGNJ1qraQZ4RVRc,4775
35
32
  notionary/database/database_exceptions.py,sha256=jwFdxoIQHLO3mO3p5t890--1FjbTX60fNyqBAe-sszo,452
36
33
  notionary/database/factory.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
34
  notionary/database/filter_builder.py,sha256=4EJnWUF73l5oi-HnvMu-mI1OncLzEs2o2mr_xG75quk,6315
38
- notionary/database/notion_database.py,sha256=fM6lmL673bKQPfDDj6tyj8K7yO0gSi8veEiUIE5enF8,15497
39
- notionary/database/notion_database_provider.py,sha256=2zaRycrbnceV_EbZugdNM_YF9iCGBen-A6E4jvZe2mU,9119
40
35
  notionary/database/models/page_result.py,sha256=Vmm5_oYpYAkIIJVoTd1ZZGloeC3cmFLMYP255mAmtaw,233
36
+ notionary/database/notion_database.py,sha256=jA3_x-pMJdcI6-ZDiSrx43ywaFaw0MLRW8wYb7DOlvQ,15755
37
+ notionary/database/notion_database_provider.py,sha256=GVfS8fgf5RhX15y8gpvRjBkQbv--8WFgKBkI_Z5LRaU,9009
41
38
  notionary/elements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
39
  notionary/models/notion_block_response.py,sha256=gzL4C6K9QPcaMS6NbAZaRceSEnMbNwYBVVzxysza5VU,6002
43
40
  notionary/models/notion_database_response.py,sha256=3kvADIP1dSxgITSK4n8Ex3QpF8n_Lxnu_IXbPVGcq4o,7648
@@ -45,28 +42,30 @@ notionary/models/notion_page_response.py,sha256=7ZwDYhlyK-avix_joQpGuNQZopjlQFI8
45
42
  notionary/models/search_response.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
43
  notionary/page/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
44
  notionary/page/client.py,sha256=XQ72lOEwn-gO8fmhKSKHqSHs3hRmoKH0TkJ3TtblcAg,4030
48
- notionary/page/markdown_syntax_prompt_generator.py,sha256=uHCPNV9aQi3GzLVimyUKwza29hfxu6DTMVIa_QevJbk,4987
49
- notionary/page/notion_page.py,sha256=xxvXJz3wg1TCUyjN6-U6na9zps4fsLlwoVAj3ylBLLA,19151
50
- notionary/page/notion_to_markdown_converter.py,sha256=_MJWWwsBvgZ3a8tLZ23ZCIA_G9Qfvt2JG1FqVTlRxHs,6308
51
- notionary/page/property_formatter.py,sha256=_978ViH83gfcr-XtDscWTfyBI2srGW2hzC-gzgp5NR8,3788
52
- notionary/page/search_filter_builder.py,sha256=wZpW_KHmPXql3sNIyQd9EzZ2-ERy2i0vYNdoLkoBUfc,4597
53
- notionary/page/utils.py,sha256=2nfBrWeczBdPH13R3q8dKP4OY4MwEdfKbcs2UJ9kg1o,2041
54
45
  notionary/page/content/notion_page_content_chunker.py,sha256=kWJnV9GLU5YLgSVPKOjwMBbG_CMAmVRkuDtwJYb_UAA,3316
55
46
  notionary/page/content/page_content_retriever.py,sha256=iNazSf0uv_gi0J816-SZn4Lw4qbAxRHG90k9Jy_qw2Q,1587
56
47
  notionary/page/content/page_content_writer.py,sha256=VVvK-Z8NvyIhi7Crcm9mZQuuD_L72NsqSQg9gf33Zwk,7369
57
48
  notionary/page/formatting/markdown_to_notion_converter.py,sha256=9RyGON8VrJv6XifdQdOt5zKgKT3irc974zcbGDBhmLY,17328
58
49
  notionary/page/formatting/spacer_rules.py,sha256=j2RHvdXT3HxXPVBEuCtulyy9cPxsEcOmj71pJqV-D3M,15677
50
+ notionary/page/markdown_syntax_prompt_generator.py,sha256=uHCPNV9aQi3GzLVimyUKwza29hfxu6DTMVIa_QevJbk,4987
51
+ notionary/page/notion_page.py,sha256=PAwixEuzn5mnkIU4AtOKHiaaG98fmVqFhPe4Mjnb9bA,19110
52
+ notionary/page/notion_to_markdown_converter.py,sha256=_MJWWwsBvgZ3a8tLZ23ZCIA_G9Qfvt2JG1FqVTlRxHs,6308
59
53
  notionary/page/properites/property_value_extractor.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
- notionary/util/__init__.py,sha256=EzAmP2uEFfazWapb41BY9kAua1ZEiuLRPaBMtw_cOYg,358
54
+ notionary/page/property_formatter.py,sha256=_978ViH83gfcr-XtDscWTfyBI2srGW2hzC-gzgp5NR8,3788
55
+ notionary/page/search_filter_builder.py,sha256=wZpW_KHmPXql3sNIyQd9EzZ2-ERy2i0vYNdoLkoBUfc,4597
56
+ notionary/page/utils.py,sha256=2nfBrWeczBdPH13R3q8dKP4OY4MwEdfKbcs2UJ9kg1o,2041
57
+ notionary/telemetry/__init__.py,sha256=Y7KyXeN4PiA6GtzV3NnwoH4hJnPwdjikWP22ckPYuHM,511
58
+ notionary/telemetry/service.py,sha256=DD7RbkSN0HWRK2YpOJTgFD7PeXGhSe9KrLkhiVIaC7Y,4763
59
+ notionary/telemetry/views.py,sha256=BXVa25h0A4leGaz5U9F-T5ebShkojD-DvYElWkrP6U4,1762
60
+ notionary/util/__init__.py,sha256=JAOxIchioEx4h_KcRs8mqgBjPveoNmzqkNzdQZnokNk,438
61
61
  notionary/util/factory_decorator.py,sha256=3SD63EPxXMmKQ8iF7sF88xUFMG8dy14L2DJZ7XdcYm4,1110
62
62
  notionary/util/fuzzy_matcher.py,sha256=RYR86hMTp8lrWl3PeOa3RpDpzh04HJ30qrIlrq6_qDo,2442
63
63
  notionary/util/logging_mixin.py,sha256=d5sRSmUtgQeuckdNBkO025IXPGe4oOb-7ueVAIP8amU,1846
64
64
  notionary/util/page_id_utils.py,sha256=AA00kRO-g3Cc50tf_XW_tb5RBuPKLuBxRa0D8LYhLXg,736
65
65
  notionary/util/singleton_decorator.py,sha256=CKAvykndwPRZsA3n3MAY_XdCR59MBjjKP0vtm2BcvF0,428
66
66
  notionary/util/singleton_metaclass.py,sha256=uNeHiqS6TwhljvG1RE4NflIp2HyMuMmrCg2xI-vxmHE,809
67
- notionary-0.2.14.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
68
- notionary-0.2.14.dist-info/METADATA,sha256=R94Tb7hWlk_LhA7bKSbgyLe6K9GgcZstI0WAfaNw1qU,7678
69
- notionary-0.2.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- notionary-0.2.14.dist-info/entry_points.txt,sha256=V7X21u3QNm7h7p6Cx0Sx2SO3mtmA7gVwXM8lNYnv9fk,54
71
- notionary-0.2.14.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
72
- notionary-0.2.14.dist-info/RECORD,,
67
+ notionary/workspace.py,sha256=kW9fbVUSECivlvABBwnks2nALfk09V6g6Oc2Eq_pK5U,2511
68
+ notionary-0.2.16.dist-info/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
69
+ notionary-0.2.16.dist-info/METADATA,sha256=qy_xKJWjzGlY0zZcJ4T2hZtFgjMmgZhRSEqaQc8Hlqo,6824
70
+ notionary-0.2.16.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
71
+ notionary-0.2.16.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-