notionary 0.2.18__tar.gz → 0.2.19__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.
- {notionary-0.2.18 → notionary-0.2.19}/PKG-INFO +1 -1
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/models.py +3 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/content/page_content_retriever.py +17 -9
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/formatting/markdown_to_notion_converter.py +1 -1
- notionary-0.2.19/notionary/util/factory_decorator.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/pyproject.toml +1 -1
- {notionary-0.2.18 → notionary-0.2.19}/LICENSE +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/README.md +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/base_notion_client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/audio/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/audio/audio_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/audio/audio_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/audio/audio_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bookmark/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bookmark/bookmark_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bookmark/bookmark_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bookmark/bookmark_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/callout/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/callout/callout_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/callout/callout_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/callout/callout_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/code/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/code/code_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/code/code_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/code/code_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/column/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/column/column_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/column/column_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/divider/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/divider/divider_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/divider/divider_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/divider/divider_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/document/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/document/document_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/document/document_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/document/document_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/embed/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/embed/embed_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/embed/embed_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/embed/embed_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/heading/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/heading/heading_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/heading/heading_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/heading/heading_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/image/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/image/image_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/image/image_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/image/image_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/markdown_builder.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/mention/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/mention/mention_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/mention/mention_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/mention/mention_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/paragraph/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/paragraph/paragraph_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/paragraph/paragraph_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/paragraph/paragraph_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/prompts/element_prompt_builder.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/prompts/element_prompt_content.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/quote/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/quote/quote_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/quote/quote_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/quote/quote_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/registry/block_registry.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/registry/block_registry_builder.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/block_client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/notion_block_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/text_inline_formatter.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/shared/text_inline_formatter_new.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/table/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/table/table_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/table/table_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/table/table_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/todo/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/todo/todo_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/todo/todo_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/todo/todo_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggle/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggle/toggle_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggle/toggle_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggle/toggle_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggleable_heading/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggleable_heading/toggleable_heading_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggleable_heading/toggleable_heading_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/toggleable_heading/toggleable_heading_models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/video/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/video/video_element.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/video/video_markdown_node.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/database.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/database_filter_builder.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/database_provider.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/exceptions.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/factory.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/models/page_result.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/database/notion_database.py +0 -0
- {notionary-0.2.18/notionary/page → notionary-0.2.19/notionary/elements}/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/file_upload/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/file_upload/client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/file_upload/models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/file_upload/notion_file_upload.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/models/notion_block_response.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/models/notion_database_response.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/models/notion_page_response.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/models/search_response.py +0 -0
- /notionary-0.2.18/notionary/page/properites/property_value_extractor.py → /notionary-0.2.19/notionary/page/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/content/markdown_whitespace_processor.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/content/notion_text_length_utils.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/content/page_content_writer.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/formatting/line_processor.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/markdown_syntax_prompt_generator.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/notion_page.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/notion_to_markdown_converter.py +0 -0
- /notionary-0.2.18/notionary/util/factory_decorator.py → /notionary-0.2.19/notionary/page/properites/property_value_extractor.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/property_formatter.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/search_filter_builder.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/page/utils.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/telemetry/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/telemetry/service.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/telemetry/views.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/base_notion_user.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/client.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/models.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/notion_bot_user.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/notion_user.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/notion_user_manager.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/user/notion_user_provider.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/__init__.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/factory_only.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/fuzzy.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/logging_mixin.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/page_id_utils.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/singleton.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/util/singleton_metaclass.py +0 -0
- {notionary-0.2.18 → notionary-0.2.19}/notionary/workspace.py +0 -0
@@ -29,6 +29,7 @@ BlockColor = Literal[
|
|
29
29
|
"purple_background",
|
30
30
|
"red",
|
31
31
|
"red_background",
|
32
|
+
"default_background"
|
32
33
|
]
|
33
34
|
|
34
35
|
BlockType = Literal[
|
@@ -577,6 +578,8 @@ class Block(BaseModel):
|
|
577
578
|
archived: bool = False
|
578
579
|
in_trash: bool = False
|
579
580
|
has_children: bool = False
|
581
|
+
|
582
|
+
children: Optional[list[Block]] = None # for recursive structure
|
580
583
|
|
581
584
|
# Block type-specific content (only one will be populated based on type)
|
582
585
|
audio: Optional[AudioBlock] = None
|
@@ -1,8 +1,10 @@
|
|
1
|
+
import json
|
1
2
|
from typing import Any, Dict, Optional
|
2
3
|
|
3
4
|
from notionary.blocks.registry.block_registry import BlockRegistry
|
4
5
|
|
5
6
|
from notionary.blocks import NotionBlockClient
|
7
|
+
from notionary.blocks.shared.models import Block
|
6
8
|
from notionary.page.notion_to_markdown_converter import (
|
7
9
|
NotionToMarkdownConverter,
|
8
10
|
)
|
@@ -23,30 +25,36 @@ class PageContentRetriever(LoggingMixin):
|
|
23
25
|
|
24
26
|
async def get_page_content(self) -> str:
|
25
27
|
blocks = await self._get_page_blocks_with_children()
|
26
|
-
|
28
|
+
|
29
|
+
# TODO: Fix this quick fix🧯 Quick-Fix: Konvertiere rekursive Block-Objekte in plain dicts
|
30
|
+
blocks_as_dicts = [block.model_dump(mode="python", exclude_unset=True) for block in blocks]
|
31
|
+
|
32
|
+
return self._notion_to_markdown_converter.convert(blocks_as_dicts)
|
27
33
|
|
28
34
|
async def _get_page_blocks_with_children(
|
29
35
|
self, parent_id: Optional[str] = None
|
30
|
-
) -> list[
|
31
|
-
|
32
|
-
await self.client.
|
36
|
+
) -> list[Block]:
|
37
|
+
response = (
|
38
|
+
await self.client.get_block_children(block_id=self.page_id)
|
33
39
|
if parent_id is None
|
34
40
|
else await self.client.get_block_children(parent_id)
|
35
41
|
)
|
36
42
|
|
37
|
-
if not
|
43
|
+
if not response or not response.results:
|
38
44
|
return []
|
39
45
|
|
46
|
+
blocks = response.results
|
47
|
+
|
40
48
|
for block in blocks:
|
41
|
-
if not block.
|
49
|
+
if not block.has_children:
|
42
50
|
continue
|
43
51
|
|
44
|
-
block_id = block.
|
52
|
+
block_id = block.id
|
45
53
|
if not block_id:
|
46
54
|
continue
|
47
55
|
|
48
56
|
children = await self._get_page_blocks_with_children(block_id)
|
49
57
|
if children:
|
50
|
-
block
|
58
|
+
block.children = children
|
51
59
|
|
52
|
-
return blocks
|
60
|
+
return blocks
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/page/formatting/markdown_to_notion_converter.py
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
from notionary.blocks import ColumnElement, BlockRegistry
|
2
2
|
from notionary.page.formatting.line_processor import LineProcessor
|
3
3
|
|
4
|
-
|
4
|
+
# TODO: Hier rekursiven Baum Parser verwenden!
|
5
5
|
class MarkdownToNotionConverter:
|
6
6
|
"""Clean converter focused on block identification and conversion"""
|
7
7
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_element.py
RENAMED
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_markdown_node.py
RENAMED
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/bulleted_list/bulleted_list_models.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_element.py
RENAMED
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_markdown_node.py
RENAMED
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/blocks/numbered_list/numbered_list_models.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{notionary-0.2.18 → notionary-0.2.19}/notionary/page/content/markdown_whitespace_processor.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|