{"id":13495930,"url":"https://github.com/narkdown/narkdown-py","last_synced_at":"2025-03-28T17:34:25.235Z","repository":{"id":53499371,"uuid":"295449493","full_name":"narkdown/narkdown-py","owner":"narkdown","description":"A tool to use Notion as a Markdown editor.","archived":true,"fork":false,"pushed_at":"2021-03-28T02:33:19.000Z","size":4558,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-19T20:48:29.112Z","etag":null,"topics":["cms","notion"],"latest_commit_sha":null,"homepage":"https://narkdown.notion.site/Narkdown-en-6eeb0ce1872d4098abca86a30cb29ab4","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narkdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-14T14:55:11.000Z","updated_at":"2025-03-11T12:03:20.000Z","dependencies_parsed_at":"2022-08-19T05:31:39.250Z","dependency_job_id":null,"html_url":"https://github.com/narkdown/narkdown-py","commit_stats":null,"previous_names":["younho9/narkdown"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narkdown%2Fnarkdown-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narkdown%2Fnarkdown-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narkdown%2Fnarkdown-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narkdown%2Fnarkdown-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narkdown","download_url":"https://codeload.github.com/narkdown/narkdown-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246069751,"owners_count":20718784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","notion"],"created_at":"2024-07-31T19:01:39.835Z","updated_at":"2025-03-28T17:34:24.209Z","avatar_url":"https://github.com/narkdown.png","language":"Python","funding_links":[],"categories":["Python","HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"\u003ca align=\"left\" href=\"https://www.notion.so/Narkdown-4db9629e512f43efbba98000a5c2e381\"\u003e\u003cimg src=\"docs/images/logo.png\" alt=\"Narkdown\" width=\"120px\"\u003e\u003c/a\u003e\n\n# Narkdown\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://pypi.org/project/narkdown/\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/narkdown?style=flat-square\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"PyPi - Python Version\" src=\"https://img.shields.io/pypi/pyversions/narkdown?style=flat-square\"\u003e\n  \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"code style: black\" src=\"https://img.shields.io/static/v1?label=code%20style\u0026message=black\u0026color=black\u0026style=flat-square\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"PyPI - License\" src=\"https://img.shields.io/pypi/l/narkdown?style=flat-square\"\u003e\n\u003c/p\u003e\n\n| [English](/README.md) | [한국어](/docs/README.ko.md) |\n\n**A tool to use Notion as a Markdown editor.**\n\n---\n\n\u003e ⚠️ **NOTE:** Narkdown is dependent on [notion-py](https://github.com/jamalex/notion-py), the **_unofficial_** Notion API created by [Jamie Alexandre](https://github.com/jamalex). It can not gurantee it will stay stable. If you need to use in production, I recommend waiting for their official release.\n\n---\n\n## Installation\n\n```bash\npip install narkdown\n# pip3 install narkdown\n```\n\n## Usage\n\n\u003e ⚠️ **NOTE:** the latest version of narkdown requires Python 3.5 or greater.\n\n### Quick Start\n\n#### CLI\n\n![narkdown-image-0](docs/images/readme-image-0.png)\n\n[How To Find Your Notion v2 Token - Red Gregory](https://www.redgregory.com/notion/2020/6/15/9zuzav95gwzwewdu1dspweqbv481s5)\n\n#### Python\n\n[`example.py`](https://github.com/younho9/narkdown/blob/main/example.py)\n\n![narkdown-image-1](docs/images/readme-image-1.png)\n\n```bash\npython3 example.py\n```\n\n#### Database template page for test\n\nHere is an [database template page](https://www.notion.so/acc3dfd0339e4cacb5baae8673fddfad?v=be43c1c8dd644cfb9df9efd97d8af60a) for importing pages from the database. Move to that page, duplicate it, and test it.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"70%\" src=\"docs/images/readme-image-2.png\" alt=\"narkdown-image-2\"\u003e\n\u003c/div\u003e\n\n## Features\n\n- **Import page from Notion and save it to the desired path.**\n\n- **Import database from Notion and save pages to the desired path.**\n\n  - Useful for CMS(Contents Manage System) of static pages such as blog or docs page.\n\n  - Support import by status of content.\n\n  - Support filter contents.\n\n- **Import** **_child page_** **in Notion page recursively. And import** **_linked page_** **as a Notion page link.**\n\n- **Support nested block. (e.g. bulleted, numbered, to-do, toggle)**\n\n- **Support language selection of code block.**\n\n## Configuring Narkdown\n\nNarkdown provides some configuration for how to extract documents. You can configure Narkdown via `narkdown.config.json` .\n\nCreate `narkdown.config.json` and run `python3 -m narkdown` in that directory.\n\n```json\n// narkdown.config.json\n{\n  \"exportConfig\": {\n    \"recursiveExport\": true,\n    \"createPageDirectory\": true,\n    \"addMetadata\": true,\n    \"appendCreatedTime\": true,\n    \"generateSlug\": true\n  },\n  \"databaseConfig\": {\n    \"categoryColumnName\": \"Category\",\n    \"statusColumnName\": \"Status\",\n    \"currentStatus\": \"✅ Completed\",\n    \"nextStatus\": \"🖨 Published\"\n  }\n}\n```\n\n\u003cbr /\u003e\n\n| Name                  | Description                                                                                       | Default   |\n| --------------------- | ------------------------------------------------------------------------------------------------- | --------- |\n| `recursiveExport`     | Whether or not to recursively export child page.                                                  | [`true`]  |\n| `createPageDirectory` | Whether or not to create subdirectories with page titles for each page.                           | [`true`]  |\n| `addMetadata`         | Whether or not to add metadata to content.                                                        | [`false`] |\n| `appendCreatedTime`   | Whether or not to append created time to filename. ( The page must have a created time property.) | [`false`] |\n| `generateSlug`        | Whether or not to generate and append slug to metatdata.                                          | [`false`] |\n\n\u003cbr /\u003e\n\n| Name                 | Description                                                                                                                                                                                                                                                                                                                       | Default |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |\n| `categoryColumnName` | In Notion database, content can be classified by category by `select` property. When you create the `select` property in the Notion database and pass the name of the column, folders are created by category.                                                                                                                    | [`\"\"`]  |\n| `statusColumnName`   | In the Notion database, you can manage the status of content with `Select` property. If you create a `Select` property in the Notion database and pass the name of the column, you can import contents in a specific state or change the status of the content. (should be used with the `currentStatus` or `nextStatus` option.) | [`\"\"`]  |\n| `currentStatus`      | Import only the content that corresponds to `currentStatus` value. ( `statusColumnName` must be set.)                                                                                                                                                                                                                             | [`\"\"`]  |\n| `nextStatus`         | Changes content status to `nextStatus` value after import. ( `statusColumnName` must be set.)                                                                                                                                                                                                                                     | [`\"\"`]  |\n\n#### Set env variable for `token_v2`\n\nThe `token_v2` of notion is a variable that should not be shared. You can use os environment variable for notion token.\n\nNarkdown use the `NOTION_TOKEN` as an environment variable for `token_v2`. Setting this environment variable allow the CLI to omit `token_v2` input.\n\n## Advanced\n\n### [Notion2Github](https://github.com/younho9/notion2github) `recommended`\n\nGithub action to synchronize the content of the notion database with github.\n\n## Supported Blocks\n\n| Block Type           | Supported | Notes                                                                                           |\n| -------------------- | --------- | ----------------------------------------------------------------------------------------------- |\n| Heading 1            | ✅ Yes    | [Converted to heading 2 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa)  |\n| Heading 2            | ✅ Yes    | [Converted to heading 3 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa)  |\n| Heading 3            | ✅ Yes    | [Converted to heading 4 in markdown.](https://www.notion.so//11acfd542ee84640b3fb1782ce9b8caa)  |\n| Text                 | ✅ Yes    |                                                                                                 |\n| Divider              | ✅ Yes    | Divider after the Heading 1 is not added.                                                       |\n| Callout              | ✅ Yes    | Callout block will be exported as quote block with emoji.                                       |\n| Quote                | ✅ Yes    |                                                                                                 |\n| Bulleted list        | ✅ Yes    | Support nested block.                                                                           |\n| Numbered list        | ✅ Yes    | Support nested block.                                                                           |\n| To-do list           | ✅ Yes    | Support nested block.                                                                           |\n| Toggle list          | ✅ Yes    | Support nested block.                                                                           |\n| Code                 | ✅ Yes    | Support syntax highlighting.                                                                    |\n| Image                | ✅ Yes    | Uploaded image will be downloaded to local. Linked image will be linked not be downloaded.      |\n| Web bookmark         | ✅ Yes    | Same as link text.                                                                              |\n| Page                 | ✅ Yes    | Import \"Child page\" in Notion page recursively. And import \"Linked page\" as a Notion page link. |\n| Table (aka database) | ✅ Yes    |                                                                                                 |\n| Video                | ❌ No     |                                                                                                 |\n| Audio                | ❌ No     |                                                                                                 |\n| File                 | ❌ No     |                                                                                                 |\n| Embed other services | ❌ No     |                                                                                                 |\n| Advanced             | ❌ No     |                                                                                                 |\n| Layout in page       | ❌ No     |                                                                                                 |\n\n### License\n\nMIT © [younho9](https://github.com/younho9)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarkdown%2Fnarkdown-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarkdown%2Fnarkdown-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarkdown%2Fnarkdown-py/lists"}