Cli
cli
¶
app = typer.Typer(name=f'Ultimate Notion {__version__}', help='🚀 The ultimate Python client for Notion!')
module-attribute
¶
console = Console()
module-attribute
¶
LogLevel
¶
config(*, verbose: Annotated[bool, typer.Option(--verbose, -v, help='Show detailed error information')] = False) -> None
¶
Display the current configuration file path and contents
handle_exceptions(*, verbose: bool = False)
¶
Decorator to handle exceptions based on verbose mode.
info(*, verbose: Annotated[bool, typer.Option(--verbose, -v, help='Show detailed error information')] = False) -> None
¶
Display information about the Notion integration
main(log_level: Annotated[LogLevel, typer.Option(help='Log level')] = LogLevel.WARNING) -> None
¶
Shared options for all commands
setup_logging(log_level: LogLevel) -> None
¶
Setup basic logging
upload(file_name: Annotated[str, typer.Argument(help='Path to the file to upload')], notion_page: Annotated[str, typer.Argument(help='Page name or UUID to upload the file to')], *, verbose: Annotated[bool, typer.Option(--verbose, -v, help='Show detailed error information')] = False) -> None
¶
Upload a file to a Notion page and append it as a block.
The file will be uploaded to Notion and appended to the specified page. The block type is automatically determined based on the file extension: - Images (.png, .jpg, .jpeg, .gif, .webp, etc.) → Image block - Videos (.mp4, .avi, .mov, .wmv, etc.) → Video block - PDFs (.pdf) → PDF block - All other files → File block
The page can be specified either by name or by UUID. If specified by name, the name must be unique (exact match).