Metadata-Version: 2.1
Name: notion-md
Version: 1.0.0
Summary: A package for notion2md
Home-page: https://github.com/qxxiao/notion2md
Author: qxxiao
Author-email: 1063064004@qq.com
License: MIT
Platform: all
Classifier: Natural Language :: Chinese (Simplified)
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
License-File: LICENSE

# notion2md
>  use offical notion api with [**notion_client**](https://github.com/ramnes/notion-sdk-py)    

Convert multiple notion pages to markdown files and try to keep the formatting usable.

## Usage
First download this repo, then follow 4 steps:

1. Get Internal Integration Token  
   In [https://www.notion.so/my-integrations](https://www.notion.so/my-integrations), create your workspace intergarions and get token, like `secret_...`


2. download notion_client and dependencies:
```python
pip3 install notion_md
```

3. set env variable  
```shell
export NOTION_TOKEN=your token 
export NOTION_PAGES=your main page link
```
you can select a seperate open page for downloading, and put others page links in this page
**make sure you add the interation to your workspace and all your pages your will export.**


4. download files
```python
notion_md 
```
pages are saved to notion2md_files dir, default only download files storaged in notion.
BTW using a single page notion app can also output all md files, which is actually enough to use.

## surpported
用于 [Gridea](https://gridea.dev/) 类似博客端的转换，支持 notion 数据库页面属性 Tags, Cover.
- [x] normal block(header,list,code,quote,...)
- [x] link page/sub page
- [x] table
- [x] callout
- [x] inline_database(pages)
- [x] image/youtube video
- [x] file download(files in notion)

## notes  
- **`multi-level list items`, `bookmarks`, etc. make synchronous network requests, which take longer than other blocks**.
- only download files in notion, external links will be ignored.
- for database, only download pages in the database.
