Metadata-Version: 2.4
Name: bs-notion-export-prettify
Version: 1.4.4
Summary: 
License-File: LICENSE
Author: Fabre Lambeau
Author-email: fabre.lambeau@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: beautifulsoup4 (>=4.12.3,<5.0.0)
Requires-Dist: colorama (>=0.4.6,<0.5.0)
Requires-Dist: configargparse (>=1.7,<2.0)
Requires-Dist: jinja2 (>=3.1.3,<4.0.0)
Requires-Dist: playwright (>=1.42.0,<2.0.0)
Requires-Dist: pymupdf (>=1.24.0,<2.0.0)
Description-Content-Type: text/markdown

# notion-export-prettify

## Export, convert, rest.

This tool enables you to take a standard page export from Notion, and turn it into a branded PDF.

Features:
- Takes as input a zip file generated by Notion's export HTML function
- Manipulates the HTML to:
    - Clean up the content (and remove stuff you want to keep private)
    - Number headings
    - Apply custom CSS with your branding
    - Rejig the table of contents
- Apply branded headers and footers to all pages, with your custom metadata (and page numbers)
- Embed that metadata in the PDF
- Insert a branded cover page

All of those are optional, and will just be done if associated resources are available in the template.

## Templates

Templates?  Yes, you can also have several templates defined, and choose the one to apply when you run the tool.

## Programmatic Usage

The tool can be used as a Python module in addition to the CLI.

```python
from bs_notion_export_prettify import prettify

output_path = prettify(
    input_file="export.zip",        # or "export.html"
    output="my-document.pdf",       # optional, defaults to title-based name next to input
    template="example",             # optional, name, dir, or path to a template.cfg
    title="My Document",            # optional metadata
    subtitle="A subtitle",
    description="Brief description",
    project="My Project",
    author="Jane Smith",
    date="2026-04-04",
    identifier="DOC-001",
    cover_page=True,                # default True
    heading_numbers=True,           # default True
    strip_internal_info=True,       # default True
    table_of_contents=True,         # default True
)

print(f"PDF saved to {output_path}")
```

The lower-level classes are also importable for custom pipelines:

```python
from bs_notion_export_prettify import (
    NotionHtmlManipulator,
    HtmlTemplator,
    PdfMaker,
    ResourceLoader,
)
```

## Documentation

For full documentation, head to [this Notion page](https://fabrelambeau.notion.site/Notion-Export-Prettify-676b706adc09483dab72ebc89a1f210c), which you can also use as a source for the tool itself, to test it.


