notionary 0.2.13__py3-none-any.whl → 0.2.14__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.
- notionary/__init__.py +3 -16
- notionary/{notion_client.py → base_notion_client.py} +92 -98
- notionary/blocks/__init__.py +61 -0
- notionary/{elements → blocks}/audio_element.py +6 -3
- notionary/{elements → blocks}/bookmark_element.py +3 -5
- notionary/{elements → blocks}/bulleted_list_element.py +5 -6
- notionary/{elements → blocks}/callout_element.py +4 -6
- notionary/{elements → blocks}/code_block_element.py +4 -5
- notionary/{elements → blocks}/column_element.py +3 -5
- notionary/{elements → blocks}/divider_element.py +3 -5
- notionary/{elements → blocks}/embed_element.py +4 -5
- notionary/{elements → blocks}/heading_element.py +4 -7
- notionary/{elements → blocks}/image_element.py +4 -5
- notionary/{elements → blocks}/mention_element.py +3 -6
- notionary/blocks/notion_block_client.py +26 -0
- notionary/{elements → blocks}/notion_block_element.py +2 -3
- notionary/{elements → blocks}/numbered_list_element.py +4 -6
- notionary/{elements → blocks}/paragraph_element.py +4 -6
- notionary/{prompting/element_prompt_content.py → blocks/prompts/element_prompt_builder.py} +1 -40
- notionary/blocks/prompts/element_prompt_content.py +41 -0
- notionary/{elements → blocks}/qoute_element.py +4 -5
- notionary/{elements → blocks}/registry/block_registry.py +4 -26
- notionary/{elements → blocks}/registry/block_registry_builder.py +26 -25
- notionary/{elements → blocks}/table_element.py +5 -6
- notionary/{elements → blocks}/text_inline_formatter.py +1 -4
- notionary/{elements → blocks}/todo_element.py +5 -6
- notionary/{elements → blocks}/toggle_element.py +3 -5
- notionary/{elements → blocks}/toggleable_heading_element.py +4 -6
- notionary/{elements → blocks}/video_element.py +4 -5
- notionary/cli/main.py +157 -128
- notionary/cli/onboarding.py +10 -9
- notionary/database/__init__.py +0 -0
- notionary/database/client.py +132 -0
- notionary/database/database_exceptions.py +13 -0
- notionary/database/factory.py +0 -0
- notionary/database/filter_builder.py +175 -0
- notionary/database/notion_database.py +339 -126
- notionary/database/notion_database_provider.py +230 -0
- notionary/elements/__init__.py +0 -0
- notionary/models/notion_database_response.py +294 -13
- notionary/models/notion_page_response.py +9 -31
- notionary/models/search_response.py +0 -0
- notionary/page/__init__.py +0 -0
- notionary/page/client.py +110 -0
- notionary/page/content/page_content_retriever.py +5 -20
- notionary/page/content/page_content_writer.py +3 -4
- notionary/page/formatting/markdown_to_notion_converter.py +1 -3
- notionary/{prompting → page}/markdown_syntax_prompt_generator.py +1 -2
- notionary/page/notion_page.py +354 -317
- notionary/page/notion_to_markdown_converter.py +1 -4
- notionary/page/properites/property_value_extractor.py +0 -64
- notionary/page/{properites/property_formatter.py → property_formatter.py} +7 -4
- notionary/page/search_filter_builder.py +131 -0
- notionary/page/utils.py +60 -0
- notionary/util/__init__.py +12 -3
- notionary/util/factory_decorator.py +33 -0
- notionary/util/fuzzy_matcher.py +82 -0
- notionary/util/page_id_utils.py +0 -21
- notionary/util/singleton_metaclass.py +22 -0
- notionary/workspace.py +69 -0
- {notionary-0.2.13.dist-info → notionary-0.2.14.dist-info}/METADATA +4 -1
- notionary-0.2.14.dist-info/RECORD +72 -0
- notionary/database/database_discovery.py +0 -142
- notionary/database/notion_database_factory.py +0 -190
- notionary/exceptions/database_exceptions.py +0 -76
- notionary/exceptions/page_creation_exception.py +0 -9
- notionary/page/metadata/metadata_editor.py +0 -150
- notionary/page/metadata/notion_icon_manager.py +0 -77
- notionary/page/metadata/notion_page_cover_manager.py +0 -56
- notionary/page/notion_page_factory.py +0 -328
- notionary/page/properites/database_property_service.py +0 -302
- notionary/page/properites/page_property_manager.py +0 -152
- notionary/page/relations/notion_page_relation_manager.py +0 -350
- notionary/page/relations/notion_page_title_resolver.py +0 -104
- notionary/page/relations/page_database_relation.py +0 -68
- notionary/util/warn_direct_constructor_usage.py +0 -54
- notionary-0.2.13.dist-info/RECORD +0 -67
- /notionary/util/{singleton.py → singleton_decorator.py} +0 -0
- {notionary-0.2.13.dist-info → notionary-0.2.14.dist-info}/WHEEL +0 -0
- {notionary-0.2.13.dist-info → notionary-0.2.14.dist-info}/entry_points.txt +0 -0
- {notionary-0.2.13.dist-info → notionary-0.2.14.dist-info}/licenses/LICENSE +0 -0
- {notionary-0.2.13.dist-info → notionary-0.2.14.dist-info}/top_level.txt +0 -0
@@ -1,54 +0,0 @@
|
|
1
|
-
import functools
|
2
|
-
import inspect
|
3
|
-
from typing import Callable, Any, TypeVar, cast
|
4
|
-
|
5
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
6
|
-
|
7
|
-
|
8
|
-
def warn_direct_constructor_usage(func: F) -> F:
|
9
|
-
"""
|
10
|
-
Method decorator that logs a warning when the constructor is called directly
|
11
|
-
instead of through a factory method.
|
12
|
-
|
13
|
-
This is an advisory decorator - it only logs a warning and doesn't
|
14
|
-
prevent direct constructor usage.
|
15
|
-
"""
|
16
|
-
|
17
|
-
@functools.wraps(func)
|
18
|
-
def wrapper(self, *args, **kwargs):
|
19
|
-
# Get the call stack
|
20
|
-
stack = inspect.stack()
|
21
|
-
|
22
|
-
self._from_factory = False
|
23
|
-
|
24
|
-
search_depth = min(6, len(stack))
|
25
|
-
|
26
|
-
for i in range(1, search_depth):
|
27
|
-
if i >= len(stack):
|
28
|
-
break
|
29
|
-
|
30
|
-
caller_frame = stack[i]
|
31
|
-
caller_name = caller_frame.function
|
32
|
-
|
33
|
-
# Debug logging might be helpful during development
|
34
|
-
# print(f"Frame {i}: {caller_name}")
|
35
|
-
|
36
|
-
# If called from a factory method, mark it and break
|
37
|
-
if caller_name.startswith("create_from_") or caller_name.startswith(
|
38
|
-
"from_"
|
39
|
-
):
|
40
|
-
self._from_factory = True
|
41
|
-
break
|
42
|
-
|
43
|
-
# If not from factory, log warning
|
44
|
-
if not self._from_factory and hasattr(self, "logger"):
|
45
|
-
self.logger.warning(
|
46
|
-
"Advisory: Direct constructor usage is discouraged. "
|
47
|
-
"Consider using factory methods like create_from_page_id(), "
|
48
|
-
"create_from_url(), or create_from_page_name() instead."
|
49
|
-
)
|
50
|
-
|
51
|
-
# Call the original __init__
|
52
|
-
return func(self, *args, **kwargs)
|
53
|
-
|
54
|
-
return cast(F, wrapper)
|
@@ -1,67 +0,0 @@
|
|
1
|
-
notionary/__init__.py,sha256=U7I4nffaEt1Gfg6N7TFupC_GQVZttLhW5u0qjVX7gP4,717
|
2
|
-
notionary/notion_client.py,sha256=gkREAr8LkUUKK9cOvq72r8jNjlXDleBP2fYm7LjjbjM,7311
|
3
|
-
notionary/cli/main.py,sha256=0tmX9y_xJksKPV8evfUIxp2MTKsHAvNcq76CW4PZCSs,12836
|
4
|
-
notionary/cli/onboarding.py,sha256=I7G6eaEw_WWmbfBKBa4nHgItGyZg6iwtEw9pZylsqa4,3376
|
5
|
-
notionary/database/database_discovery.py,sha256=l9IjthwdA_Y_k_JXcAW-KnvZDwNYylIbsrQ5cpgtb5w,4484
|
6
|
-
notionary/database/notion_database.py,sha256=vbMu8FRao0nXRkSK68Q6637ypiikyMpP2zOmzGWsgpU,7595
|
7
|
-
notionary/database/notion_database_factory.py,sha256=6AK9c63R8qyQX46VY-eNL1DufHe6pK_Erka0QEBVO90,6594
|
8
|
-
notionary/database/models/page_result.py,sha256=Vmm5_oYpYAkIIJVoTd1ZZGloeC3cmFLMYP255mAmtaw,233
|
9
|
-
notionary/elements/audio_element.py,sha256=m1zMUYkpQNPCx9S0KpU85ps7pnm9Pzu4lglKYzOozF4,5343
|
10
|
-
notionary/elements/bookmark_element.py,sha256=M_vGJfBVVhUDa7sDfHB622m1Q9wEn4Lw0pCmuDkxpvQ,8143
|
11
|
-
notionary/elements/bulleted_list_element.py,sha256=dyWNu28l_fG6fob5zQzMadnWb5g_B2n7ixCHwaniPdE,2662
|
12
|
-
notionary/elements/callout_element.py,sha256=OVaRLdxNFXTJnMzmfg3SZClOAYfJ4oORSr_Skm5EOPA,4490
|
13
|
-
notionary/elements/code_block_element.py,sha256=hBMn3VpFJLgq12llvdSFkjLX05poMCIZWsBaUF9ZOQA,7527
|
14
|
-
notionary/elements/column_element.py,sha256=VpPe2yVvozMFIladOMxMh0Q1nsND_XysYxpxWoIH8eU,12732
|
15
|
-
notionary/elements/divider_element.py,sha256=sqfs1YRVqsEFlKdBOX9p8K2Ise2lDb19HwcwHM_R7nU,2330
|
16
|
-
notionary/elements/embed_element.py,sha256=PkoaycRel6bAVkP1XHv57vuLVwFmzgeZYKqM5AT8Lg0,4577
|
17
|
-
notionary/elements/heading_element.py,sha256=zgqC6alKoaucpeWDpDJd-TIsbMoJzNI5_BGP-D8Xbsc,3166
|
18
|
-
notionary/elements/image_element.py,sha256=rd9P9BT9YUwofO24JadH7bMtQCJLxVHdjHF1_ykGS-g,4756
|
19
|
-
notionary/elements/mention_element.py,sha256=-AVZ8rn6y-S9Paw-vUDZpa8nhn0dR5L_0qNjd9dQI_s,8225
|
20
|
-
notionary/elements/notion_block_element.py,sha256=utWHp_JZSRQgNIWiZfJfzwl7y2ALuDqGTY-Ve3OoQeg,1285
|
21
|
-
notionary/elements/numbered_list_element.py,sha256=kgJfQQ5FIKZVRjygd6sLJKkE9-IDlx-MFAEaxWVsg84,2661
|
22
|
-
notionary/elements/paragraph_element.py,sha256=oOIRkknpEEAw5Pr81D6c-L6cGRvaZGtggLT3iVYGC4Q,3253
|
23
|
-
notionary/elements/qoute_element.py,sha256=SCvNWht-38EwMIsDg19VPajKNc1IhZBP3oVxLQw_yVA,6120
|
24
|
-
notionary/elements/table_element.py,sha256=6yTY0fNT_Ae2ncwGQE0CSsfCxGNvnDblTTzd3kdz-Sw,11247
|
25
|
-
notionary/elements/text_inline_formatter.py,sha256=q1WePwTxhSkjhTFylcyAbhxaWLo_sjYS3Q_mIPgsKb4,8625
|
26
|
-
notionary/elements/todo_element.py,sha256=BKw3KvjdDsZIlSXoqV52z9R-a3KBzkH-9DKo4dN7m9w,4122
|
27
|
-
notionary/elements/toggle_element.py,sha256=sg3LfblBRa0pIrcSBHPRknq6FYWB5-mpDGvA7PBOZ9U,11080
|
28
|
-
notionary/elements/toggleable_heading_element.py,sha256=sKvjD_x61QYOM4l8gfq6VodpLWqxf8FR2JGWXNeee08,9958
|
29
|
-
notionary/elements/video_element.py,sha256=IlB88CmBueYPSFh6p7kxE5zVjcZBQJJ1K953G7kg99M,5725
|
30
|
-
notionary/elements/registry/block_registry.py,sha256=g0id_Q6guzTyNY6HfnB9AjOBvCR4CvtpnUeFAY8kgY0,5027
|
31
|
-
notionary/elements/registry/block_registry_builder.py,sha256=5zRKnw2102rAeHpANs6Csu4DVufOazf1peEovChWcgs,9572
|
32
|
-
notionary/exceptions/database_exceptions.py,sha256=I-Tx6bYRLpi5pjGPtbT-Mqxvz3BFgYTiuZxknJeLxtI,2638
|
33
|
-
notionary/exceptions/page_creation_exception.py,sha256=4v7IuZD6GsQLrqhDLriGjuG3ML638gAO53zDCrLePuU,281
|
34
|
-
notionary/models/notion_block_response.py,sha256=gzL4C6K9QPcaMS6NbAZaRceSEnMbNwYBVVzxysza5VU,6002
|
35
|
-
notionary/models/notion_database_response.py,sha256=FMAasQP20S12J_KMdMlNpcHHwxFKX2YtbE4Q9xn-ruQ,1213
|
36
|
-
notionary/models/notion_page_response.py,sha256=r4fwMwwDocj92JdbSmyrzIqBKsnEaz4aDUiPabrg9BM,1762
|
37
|
-
notionary/page/notion_page.py,sha256=CnEr5S425t7r8n4mZERwShlXsXnR2G7bbYjO8yb2oaU,18032
|
38
|
-
notionary/page/notion_page_factory.py,sha256=_dsvxn3xmjZFQw3fKIhnTwiIQfk7p8pxVOFj1GMvBZc,11763
|
39
|
-
notionary/page/notion_to_markdown_converter.py,sha256=vUQss0J7LUFLULGvW27PjaTFuWi8OsRQAUBowSYorkM,6408
|
40
|
-
notionary/page/content/notion_page_content_chunker.py,sha256=kWJnV9GLU5YLgSVPKOjwMBbG_CMAmVRkuDtwJYb_UAA,3316
|
41
|
-
notionary/page/content/page_content_retriever.py,sha256=MoRNwVyBacQEPFu-XseahKEFait0q8tjuhFUXHOBrMo,2208
|
42
|
-
notionary/page/content/page_content_writer.py,sha256=PkH3i3sE8zbAUS8dtMbWHwKyq8yubuvzXCzeBZeUFKA,7436
|
43
|
-
notionary/page/formatting/markdown_to_notion_converter.py,sha256=-CdGefHdeXtF3TyipOLkyrD6yFJbFDLmZMveoDiYBLo,17463
|
44
|
-
notionary/page/formatting/spacer_rules.py,sha256=j2RHvdXT3HxXPVBEuCtulyy9cPxsEcOmj71pJqV-D3M,15677
|
45
|
-
notionary/page/metadata/metadata_editor.py,sha256=0I-h5BbLpI_VbAobSdslK8G7TPWoHJb_fAPDtDEOc08,5116
|
46
|
-
notionary/page/metadata/notion_icon_manager.py,sha256=_K23i1qsBW052ZuDez5X1l3S9zTRwkRoTnHnoeED98g,2562
|
47
|
-
notionary/page/metadata/notion_page_cover_manager.py,sha256=2dQLw890gUGz2nEorAhGNkgLLQNlQKDa1VExABXiUOc,2201
|
48
|
-
notionary/page/properites/database_property_service.py,sha256=RWNsze5bImUz4TXVReeFNtNSxlqOylEYS4EOL3bHxdQ,9895
|
49
|
-
notionary/page/properites/page_property_manager.py,sha256=1Ga1Qf91yfxaLT55qNJuf5UMz9Z3-8xDZwEHptTqGdM,5729
|
50
|
-
notionary/page/properites/property_formatter.py,sha256=k5yFPh87PX5yMaJqZiYjP2ZI8xbxXToYc6PMwNZ8Mpw,3653
|
51
|
-
notionary/page/properites/property_value_extractor.py,sha256=5coK0-hSogSLeFL2P337ruGXuHHc447hP_Ry5niOI6M,2342
|
52
|
-
notionary/page/relations/notion_page_relation_manager.py,sha256=PiwmOex8I4iR_9T8J0v_W58vS-E_BbTE1fsnnXD3nU4,11055
|
53
|
-
notionary/page/relations/notion_page_title_resolver.py,sha256=LN89y-Tc0Rk81TiTeA5WsFqhittLLykdzn3x5Ok29YI,3561
|
54
|
-
notionary/page/relations/page_database_relation.py,sha256=nkelofYzfuIFjmM7vR6IGJpWUG9XPmSDnU1WR8WtQrs,2231
|
55
|
-
notionary/prompting/element_prompt_content.py,sha256=tHref-SKA81Ua_IQD2Km7y7BvFtHl74haSIjHNYE3FE,4403
|
56
|
-
notionary/prompting/markdown_syntax_prompt_generator.py,sha256=_1qIYlqSfI6q6Fut10t6gGwTQuS8c3QBcC_5DBme9Mo,5084
|
57
|
-
notionary/util/__init__.py,sha256=ra1jHFFiQNWYDzmVb81OVhtshzkZ0GcLVI8YDODYj3w,235
|
58
|
-
notionary/util/logging_mixin.py,sha256=d5sRSmUtgQeuckdNBkO025IXPGe4oOb-7ueVAIP8amU,1846
|
59
|
-
notionary/util/page_id_utils.py,sha256=EYNMxgf-7ghzL5K8lKZBZfW7g5CsdY0Xuj4IYmU8RPk,1381
|
60
|
-
notionary/util/singleton.py,sha256=CKAvykndwPRZsA3n3MAY_XdCR59MBjjKP0vtm2BcvF0,428
|
61
|
-
notionary/util/warn_direct_constructor_usage.py,sha256=vyJR73F95XVSRWIbyij-82IGOpAne9SBPM25eDpZfSU,1715
|
62
|
-
notionary-0.2.13.dist-info/licenses/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
|
63
|
-
notionary-0.2.13.dist-info/METADATA,sha256=jXcnz9Gqxx8vFbnLdrLhr_TiByxrWd_OMIxPPqyqHGY,7582
|
64
|
-
notionary-0.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
65
|
-
notionary-0.2.13.dist-info/entry_points.txt,sha256=V7X21u3QNm7h7p6Cx0Sx2SO3mtmA7gVwXM8lNYnv9fk,54
|
66
|
-
notionary-0.2.13.dist-info/top_level.txt,sha256=fhONa6BMHQXqthx5PanWGbPL0b8rdFqhrJKVLf_adSs,10
|
67
|
-
notionary-0.2.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|