better-notion 1.5.1__py3-none-any.whl → 1.5.2__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.
@@ -359,6 +359,38 @@ async def restore(page_id: str) -> None:
359
359
  typer.echo(result)
360
360
 
361
361
 
362
+ @app.command()
363
+ async def clear(page_id: str) -> None:
364
+ """
365
+ Clear all blocks from a page.
366
+
367
+ Deletes all content blocks from a page while keeping the page itself.
368
+ The page title and properties are preserved.
369
+ """
370
+ client = get_client()
371
+ page = await client.pages.get(page_id)
372
+
373
+ # Collect all block IDs first
374
+ block_ids = []
375
+ async for block in page.children():
376
+ block_ids.append(block.id)
377
+
378
+ # Delete all blocks
379
+ for block_id in block_ids:
380
+ try:
381
+ await client.api.blocks.delete(block_id)
382
+ except Exception:
383
+ # Continue even if deletion fails
384
+ pass
385
+
386
+ result = format_success({
387
+ "id": page_id,
388
+ "blocks_deleted": len(block_ids),
389
+ "status": "cleared",
390
+ })
391
+ typer.echo(result)
392
+
393
+
362
394
  @app.command("create-from-md")
363
395
  async def create_from_md(
364
396
  file: str = typer.Option(..., "--file", "-f", help="Path to markdown file"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: better-notion
3
- Version: 1.5.1
3
+ Version: 1.5.2
4
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
@@ -42,7 +42,7 @@ better_notion/_cli/commands/blocks.py,sha256=ErcR-SHhPoz6B9uy0xOG6CGZB-bhvny5lxB
42
42
  better_notion/_cli/commands/comments.py,sha256=dBdxvpkjk_yA_1WUivXl1Nt8Ig-uYD5-k4XtenHU_cI,4981
43
43
  better_notion/_cli/commands/config.py,sha256=3bOCmcRnpTb5SHB2TJPXdxrRshy84nZRAsULxfbSqk0,5360
44
44
  better_notion/_cli/commands/databases.py,sha256=SRfUi74Cm7YVvdwPjbcwP1g__DiZsMyY0YLQTY-skx4,12953
45
- better_notion/_cli/commands/pages.py,sha256=NZwrWDOim43FzIdtqubbXarsflnjQo2T4BGB1TJsco0,13068
45
+ better_notion/_cli/commands/pages.py,sha256=JMeD-UfrzG2cu73G4X84vZV3gjqFIvS3XifWMSFES18,13894
46
46
  better_notion/_cli/commands/plugins.py,sha256=mBYSVciwwgnCRXYOuJfSYDV2UMAr_9P8KwPuiC-pY2A,27067
47
47
  better_notion/_cli/commands/search.py,sha256=JM20W5TiohsOKLyEUABEaWr0yB82W2_qAGQ1w64_pGk,4671
48
48
  better_notion/_cli/commands/update.py,sha256=NfmijzTpCbVTEY2h0QdcJZXEiGmWkk-iyEtZCqrgmAk,4997
@@ -126,8 +126,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
126
126
  better_notion/utils/agents/schemas.py,sha256=eHfGhY90FAPXA3E8qE6gP75dgNzn-9z5Ju1FMwBKnQQ,22120
127
127
  better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
128
128
  better_notion/utils/agents/workspace.py,sha256=FYarHj8eD2OeUG0KMPelqpBavm4RnYBoW2PVuwYkKI4,13614
129
- better_notion-1.5.1.dist-info/METADATA,sha256=lLDjood4wOkoyNlgmc7IUY9doLnTz6u_6tluC4rgQG4,11096
130
- better_notion-1.5.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
131
- better_notion-1.5.1.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
132
- better_notion-1.5.1.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
133
- better_notion-1.5.1.dist-info/RECORD,,
129
+ better_notion-1.5.2.dist-info/METADATA,sha256=9aN87PKPI9zNpR7TRBVCMERbB-b-dfaYxNsoZRi2HkQ,11096
130
+ better_notion-1.5.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
131
+ better_notion-1.5.2.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
132
+ better_notion-1.5.2.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
133
+ better_notion-1.5.2.dist-info/RECORD,,