{"id":20128732,"url":"https://github.com/nriver/trilium-py","last_synced_at":"2025-04-09T18:23:28.887Z","repository":{"id":44666491,"uuid":"457650117","full_name":"Nriver/trilium-py","owner":"Nriver","description":"Python client for ETAPI of Trilium Note. Trilium 的 Python版 ETAPI 客户端","archived":false,"fork":false,"pushed_at":"2024-04-22T07:12:51.000Z","size":147,"stargazers_count":100,"open_issues_count":1,"forks_count":21,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-23T10:32:25.414Z","etag":null,"topics":["etapi","markdown","migration-tool","note-taking","python","python3","trilium-notes"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nriver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-10T05:58:00.000Z","updated_at":"2024-05-20T08:25:39.206Z","dependencies_parsed_at":"2023-02-05T15:16:50.639Z","dependency_job_id":"3189582c-65a7-4170-81b0-ffa462d99ecd","html_url":"https://github.com/Nriver/trilium-py","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":"0.054545454545454564","last_synced_commit":"1a6b2f834d0feb622161f2477c068b781ee760d5"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nriver%2Ftrilium-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nriver%2Ftrilium-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nriver%2Ftrilium-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nriver%2Ftrilium-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nriver","download_url":"https://codeload.github.com/Nriver/trilium-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086059,"owners_count":21045262,"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":["etapi","markdown","migration-tool","note-taking","python","python3","trilium-notes"],"created_at":"2024-11-13T20:29:17.284Z","updated_at":"2025-04-09T18:23:28.863Z","avatar_url":"https://github.com/Nriver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐍 trilium-py\n\n\u003cp align=\"center\"\u003e\nEnglish | \u003ca href=\"README_CN.md\"\u003e简体中文\u003c/a\u003e\n\u003c/p\u003e\n\nPython client for Trilium Note's ETAPI and Web API, with additional advanced features :)\n\n[![Downloads](https://static.pepy.tech/badge/trilium-py)](https://pepy.tech/project/trilium-py)\n[![Supported Versions](https://img.shields.io/pypi/pyversions/trilium-py.svg)](https://pypi.org/project/trilium-py)\n[![Supported Versions](https://img.shields.io/pypi/v/trilium-py?color=%2334D058\u0026label=pypi%20package)](https://pypi.org/project/trilium-py)\n[![PyPI license](https://img.shields.io/pypi/l/trilium-py.svg)](https://pypi.python.org/pypi/trilium-py/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\n\n## 🦮 Table of Contents\n\n\u003c!--ts--\u003e\n* [🐍 trilium-py](#-trilium-py)\n   * [🦮 Table of Contents](#-table-of-contents)\n   * [🔧 Installation](#-installation)\n   * [🚀 Initialization](#-initialization)\n      * [ETAPI initialization](#etapi-initialization)\n      * [Web API initialization](#web-api-initialization)\n   * [📖 (Basic) ETAPI Usage](#-basic-etapi-usage)\n      * [📊 Application Information](#-application-information)\n      * [🔍 Search note](#-search-note)\n      * [🏭 Create Note](#-create-note)\n         * [🖼️ Create Image note](#️-create-image-note)\n      * [👀 Get note](#-get-note)\n      * [🔄 Update note](#-update-note)\n      * [🗑️ Delete note](#️-delete-note)\n      * [📅 Day note](#-day-note)\n      * [📤 Export note](#-export-note)\n      * [📥 import note](#-import-note)\n      * [💾 Save revision](#-save-revision)\n      * [💾 Create data backup](#-create-data-backup)\n      * [🏷 Create attribute](#-create-attribute)\n      * [Get attachment list](#get-attachment-list)\n      * [Get attachment info](#get-attachment-info)\n      * [Update attachment info](#update-attachment-info)\n      * [Get attachment content](#get-attachment-content)\n      * [Update attachment content](#update-attachment-content)\n      * [Create attachment](#create-attachment)\n   * [(Advanced Usage) ✅ TODO List](#advanced-usage--todo-list)\n      * [Add TODO item](#add-todo-item)\n      * [Check/Uncheck a TODO item](#checkuncheck-a-todo-item)\n      * [Update a TODO item](#update-a-todo-item)\n      * [Delete a TODO item](#delete-a-todo-item)\n      * [Move yesterday's unfinished todo to today](#move-yesterdays-unfinished-todo-to-today)\n   * [(Advanced Usage) 🚚 Upload Markdown files](#advanced-usage--upload-markdown-files)\n      * [Upload single Markdown file with images](#upload-single-markdown-file-with-images)\n      * [Bulk upload Markdown files in a folder](#bulk-upload-markdown-files-in-a-folder)\n         * [Import from VNote](#import-from-vnote)\n         * [Import from Joplin](#import-from-joplin)\n         * [Import from Logseq](#import-from-logseq)\n         * [Import from Obsidian](#import-from-obsidian)\n         * [Import from Youdao Note/有道云笔记](#import-from-youdao-note有道云笔记)\n         * [Import from Turtl](#import-from-turtl)\n         * [Import from other markdown software](#import-from-other-markdown-software)\n   * [(Advanced Usage) 🎨 Beautify notes](#advanced-usage--beautify-notes)\n      * [Beautify a note](#beautify-a-note)\n      * [Beautify a note and its child notes](#beautify-a-note-and-its-child-notes)\n   * [(Advanced Usage) 🧹 Sort note content](#advanced-usage--sort-note-content)\n   * [(Advanced Usage) 🧹 Delete empty new note](#advanced-usage--delete-empty-new-note)\n   * [(Advanced Usage) 🗜️ Optimize image size](#advanced-usage-️-optimize-image-size)\n   * [(Advanced Usage) 🔗 Automatically Add Internal Links](#advanced-usage--automatically-add-internal-links)\n      * [Example](#example)\n      * [Excluding Notes from Internal Linking](#excluding-notes-from-internal-linking)\n      * [Special Case: Duplicate Titles](#special-case-duplicate-titles)\n      * [Final Rule: No Self-Linking](#final-rule-no-self-linking)\n      * [Code Samples](#code-samples)\n   * [(Advanced Usage) 📝🌳 Traverse Note Tree](#advanced-usage--traverse-note-tree)\n   * [(Basic) Web API Usage](#basic-web-api-usage)\n      * [📣 Share note \u0026amp; cancel share note](#-share-note--cancel-share-note)\n   * [🛠️ Develop](#️-develop)\n   * [🔗 Original OpenAPI Documentation](#-original-openapi-documentation)\n\u003c!--te--\u003e\n\n## 🔧 Installation\n\n```bash\npython3 -m pip install trilium-py --user\n```\n\n## 🚀 Initialization\n\nIn the following code example, `ea` stands for ETAPI, and `wa` stands for Web API. Please perform the corresponding\ninitialization process based on whether you need to use the ETAPI or the Web API.\n\n### ETAPI initialization\n\nIf you have a ETAPI token, change the `server_url` and `token` to yours.\n\n```python\nfrom trilium_py.client import ETAPI\n\nserver_url = 'http://localhost:8080'\ntoken = 'YOUR_TOKEN'\nea = ETAPI(server_url, token)\n```\n\nIf you haven't created ETAPI token, you can create one with your password. Please note, you can only see this token\nonce, please save it if you want to reuse the token.\n\n```python\nfrom trilium_py.client import ETAPI\n\nserver_url = 'http://localhost:8080'\npassword = '1234'\nea = ETAPI(server_url)\ntoken = ea.login(password)\nprint(token)\n```\n\nAfter initialization, you can use Trilium ETAPI with python now.\n\n### Web API initialization\n\nYou need to login every time you use the web API due to the CSRF limit.\n\n```\nfrom trilium_py.src.trilium_py.web_client import WEBAPI\n\nserver_url = 'http://localhost:8080'\npassword = '1234'\nwa = WEBAPI(server_url)\nwa.login(password)\n```\n\nAfter initialization, you can use Trilium web API with python now.\n\n## 📖 (Basic) ETAPI Usage\n\nThese are basic function that Trilium's ETAPI provides. Down below are some simple example code to use this package.\n\n### 📊 Application Information\n\nTo start with, you can get the application information like this.\n\n```python\nprint(ea.app_info())\n```\n\nIt should give you the version of your server application and some extra information.\n\n### 🔍 Search note\n\nSearch note with keyword.\n\n```python\nres = ea.search_note(\n    search=\"python\",\n)\n\nfor x in res['results']:\n    print(x['noteId'], x['title'])\n```\n\nSearch with regular expression. For example, search and get all child notes under certain note:\n\n```python\nres = ea.search_note(\n    # regular expression search for note title\n    search=\"note.title %= '.*'\",\n    ancestorNoteId=\"Parent Note ID\",\n    fastSearch=False,\n    orderBy=[\"title\"],\n    limit=100,\n)\n```\n\nNote: `limit` will not work without `orderBy`.\n\n### 🏭 Create Note\n\nYou can create a simple note like this.\n\n```python\nres = ea.create_note(\n    parentNoteId=\"root\",\n    title=\"Simple note 1\",\n    type=\"text\",\n    content=\"Simple note example\",\n    noteId=\"note1\"\n)\n```\n\nThe `noteId` is not mandatory, if not provided, Trilium will generate a random one. You can retrieve it in the return.\n\n```python\nnoteId = res['note']['noteId']\n```\n\n#### 🖼️ Create Image note\n\nImage note is a special kind of note. You can create an image note with minimal information like this. The `image_file`\nrefers to the path of image.\n\n```python\nres = ea.create_image_note(\n    parentNoteId=\"root\",\n    title=\"Image note 1\",\n    image_file=\"shield.png\",\n)\n```\n\n### 👀 Get note\n\nTo retrieve the note's content.\n\n```python\nea.get_note_content(\"noteid\")\n```\n\nYou can get a note metadata by its id.\n\n```python\nea.get_note(note_id)\n```\n\n### 🔄 Update note\n\nUpdate note content\n\n```python\nea.update_note_content(\"noteid\", \"updated by python\")\n```\n\nModify note title\n\n```python\nea.patch_note(\n    noteId=\"noteid\",\n    title=\"Python client moded\",\n)\n```\n\n### 🗑️ Delete note\n\nSimply delete a note by id.\n\n```python\nea.delete_note(\"noteid\")\n```\n\n### 📅 Day note\n\nYou can get the content of a certain date with `get_day_note`. The date string should be in format of \"%Y-%m-%d\", e.g. \"\n2022-02-25\".\n\n```python\nea.get_day_note(\"2022-02-25\")\n```\n\nThen set/update a day note with `set_day_note`. The content should be a (html) string.\n\n```python\nea.set_day_note(date, new_content)\n```\n\n### 📤 Export note\n\nExport note comes in two formats `html` or `markdown`/`md`. Setting `noteId` to `root` will export all notes.\n\n```python\nres = ea.export_note(\n    noteId='sK5fn4T6yZRI',\n    format='md',\n    save_path='/home/nate/data/1/test.zip',\n)\n```\n\n### 📥 import note\n\nThis is the built-in feature in trilium. The input file should be a zip file.\n\n```python\nres = ea.export_note(\n    noteId='sK5fn4T6yZRI',\n    file_path='/home/nate/data/1/test.zip',\n)\n```\n\n### 💾 Save revision\n\nSave note revision manually.\n\n```\nres = ea.save_revision(\n    noteId='MJzyFRXAVaC9',\n)\n```\n\n### 💾 Create data backup\n\nThis example will create a database backup file like this `trilium-data/backup/backup-test.db`.\n\n```python\nres = ea.backup(\"test\")\n```\n\nYou can use the cron utility in Linux to schedule regular automatic backups. For example, to set up a daily backup at 3:\n00 AM, you would use the following cron expression:\n\n```bash\n0 3 * * * python /path/to/backup-script.py\n```\n\n### 🏷 Create attribute\n\nYou can create a tag for a note\n\n```python\nres = ea.create_attribute(\n    noteId='noteid',\n    type='label',\n    name='name_of_the_tag',\n    value='value_of_the_tag',\n    isInheritable=True\n)\n```\n\nThe `noteId` is not mandatory, if not provided, Trilium will generate a random one. You can retrieve it in the return.\n\n```python\nnoteId = res['note']['noteId']\n```\n\n### Get attachment list\n\nGet all attachments of a single note.\n\n```\nres = ea.get_attachments('uMJt0Ajr1CuC')\n```\n\n### Get attachment info\n\nGet image title and etc.\n\n```python\nres = ea.get_attachment('Y5V6pYq6nwXo')\n```\n\n### Update attachment info\n\nChange image title and etc.\n\n```python\nres = ea.update_attachment(\n    attachmentId='2b7pPzqocS1s', title='hello etapi', role='image', mime='image/png'\n)\n```\n\n### Get attachment content\n\nGet the real image file\n\n```python\nres = ea.get_attachment_content('icpDE4orQxlI')\nwith open('1.png', 'wb') as f:\n    f.write(res)\n```\n\n### Update attachment content\n\nReplace the image with new one\n\n```python\nres = ea.update_attachment_content('icWqV6zFtE0V', '/home/nate/data/1.png')\n```\n\n### Create attachment\n\nUpload a image file as attachment of a note.\n\n```python\nres = ea.create_attachment(\n    ownerId='8m8luXym5LxT',\n    file_path='/home/nate/data/ksnip_20230630-103509.png',\n)\n```\n\n## (Advanced Usage) ✅ TODO List\n\nWith the power of Python, I have expanded the basic usage of ETAPI. You can do something with todo list now.\n\n### Add TODO item\n\nYou can use `add_todo` to add a TODO item, param is the TODO description\n\n```python\nea.add_todo(\"买暖宝宝\")\n```\n\n### Check/Uncheck a TODO item\n\nparam is the index of the TODO item\n\n```python\nea.todo_check(0)\nea.todo_uncheck(1)\n```\n\n### Update a TODO item\n\nUse `update_todo` to update a TODO item description at certain index.\n\n```python\nea.update_todo(0, \"去码头整点薯条\")\n```\n\n### Delete a TODO item\n\nRemove a TODO item by its index.\n\n```python\nea.delete_todo(1)\n```\n\n### Move yesterday's unfinished todo to today\n\nAs the title suggests, you can move yesterday's unfinished things to today. Unfinished todo's will be deleted from\nyesterday's note.\n\n```python\nea.move_yesterday_unfinished_todo_to_today()\n```\n\n## (Advanced Usage) 🚚 Upload Markdown files\n\n### Upload single Markdown file with images\n\nYou can import Markdown file with images into Trilium now! Trilium-py will help you to upload the images and fix the\nlinks for you!\n\n```python\nres = ea.upload_md_file(\n    parentNoteId=\"root\",\n    file=\"./md-demo/manjaro 修改caps lock.md\",\n)\n```\n\n### Bulk upload Markdown files in a folder\n\nYou can upload a folder with lots of Markdown files to Trilium and preserve the folder structure!\n\n#### Import from VNote\n\nSay, upload all the notes from [VNote](https://github.com/vnotex/vnote), simply do this:\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"~/data/vnotebook/\",\n    ignoreFolder=['vx_notebook', 'vx_recycle_bin', 'vx_images', '_v_images'],\n)\n```\n\n#### Import from Joplin\n\nJoplin can be imported effortlessly.\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"/home/nate/data/joplin_data/\",\n    ignoreFolder=['_resources', ],\n)\n```\n\n#### Import from Logseq\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"/home/nate/data/logseq_data/\",\n    ignoreFolder=['assets', 'logseq'],\n)\n```\n\n#### Import from Obsidian\n\nObsidian has a very unique linking system for files. You should use [obsidian-export\n](https://github.com/zoni/obsidian-export) to convert a Obsidian vault to regular Markdown files. Then you should be\nable to import the note into Trilium with trilium-py.\n\nConvert it first.\n\n```bash\nobsidian-export /path/to/your/vault /out\n```\n\nThen import just like a normal markdown, trilium-py will handle the images for you.\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"E:/data/out\",\n)\n```\n\n#### Import from Youdao Note/有道云笔记\n\nYoudao does not provide an export feature anymore. Luckily, you can use \u003chttps://github.com/DeppWang/youdaonote-pull\u003e to\ndownload your notes and convert them into markdown files. After that, trilium-py should be able to help you import them.\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"/home/nate/gitRepo/youdaonote-pull/out/\",\n)\n```\n\n#### Import from Turtl\n\nYou need to convert Turtl from json to markdown first.\nSee [turtl-to-markdown](https://github.com/Nriver/trilium-py/tree/main/examples/turtl-to-markdown) for details.\n\nThen you can import with trilium-py like this:\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"/home/nate/gitRepo/turtl-to-markdown/out/\",\n    ignoreFolder=['_resources'],\n)\n```\n\n#### Import from other markdown software\n\nIn general, markdown files have variety of standards. You can always try import them with\n\n```python\nres = ea.upload_md_folder(\n    parentNoteId=\"root\",\n    mdFolder=\"/home/nate/data/your_markdown_files/\",\n)\n```\n\nIf there is any problem, please feel free to create an [issue](https://github.com/Nriver/trilium-py/issues/new).\n\n## (Advanced Usage) 🎨 Beautify notes\n\nBecause of the constraints imposed by the library utilized by Trilium, imported notes may experience minor formatting\nproblems. These issues include an additional line appearing at the end of code blocks, images becoming integrated with\nthe note content, and the absence of line breaks between headings, resulting in a cramped appearance of the note\ncontent.\n\nHere is what you can do to beautify your note.\n\n### Beautify a note\n\nSpecify a note id to beautify note content.\n\n```python\nea.beautify_note('krm8B9JthNfi')\n```\n\n### Beautify a note and its child notes\n\n```python\nea.beautify_sub_notes('tlPuzU2szLJh')\n```\n\n## (Advanced Usage) 🧹 Sort note content\n\nSort a note by the heading names. This feature could prove invaluable for notes containing extensive lists, such as book\ntitles sorted into various genres. It's equally useful for managing browser bookmarks or collecting links.\n\nAdditionally, you have the option to specify a language code for sorting based on your local language. This enhances the\nsorting process and tailors it to your linguistic preferences.\n\n```python\nres = ea.sort_note_content('lPxtkknjR2bJ')\nres = ea.sort_note_content('y6hROhWjNmHQ', 'zh_CN.UTF-8')\n```\n\n## (Advanced Usage) 🧹 Delete empty `new note`\n\nSometimes I inadvertently create numerous \"new notes\" which remain undeleted within my note tree. These \"new notes\"\nclutter my\nworkspace, scattered across various locations. I made this bulk deletion of these empty \"new notes.\" Additionally, it\ngenerates warning messages for \"new notes\" that contain content, maybe we should change the title for those notes.\n\n```python\nea.delete_empty_note()\n```\n\n## (Advanced Usage) 🗜️ Optimize image size\n\nTry to reduce image size by using PIL's optimize feature. If the image in your note is not compressed, you can try this.\nI've successfully convert a note of 44MB to 9.9MB after this process. Backup your data before try this.\n\nThe default quality is set to 90.\n\n`optimize_image_attachments` will keep the original image format and try to compress it.\n\n```\nea.optimize_image_attachments('uMJt0Ajr1CuC')\n```\n\nTo save even more space, you can try the following method.\n\nThe `optimize_image_attachments_to_webp` function converts images to the `WebP` format, significantly reducing file\nsizes. Based on my experience, `WebP` images can be as little as 25% to 50% of the size of `PNG` images.\n\n```\nea.optimize_image_attachments_to_webp('H2q3901uFDCH')\n```\n\nThis action can save significant space if you have many clipped pages. Whoever invented `WebP` is a genius.\n\n## (Advanced Usage) 🔗 Automatically Add Internal Links\n\nThis feature allows you to automatically create internal links within your notes. Let’s take a look at how it works.\n\n### Example\n\nHere is a sample note:\n\n![auto-link-1](docs/auto-link-1.webp)\n\nAfter running a single line of code:\n\n```python\nauto_create_internal_link('put_note_id_here')\n```\n\nThe note transforms into this:\n\n![auto-link-2](docs/auto-link-2.webp)\n\nAs you can see, some text has been replaced with internal links. The feature follows these rules:\n\n- **Title Match**: Content that matches any other note's title is replaced with an internal link.\n- **Duplicate Titles Ignored**: If multiple notes share the same title, no link is created for that title.\n- **Longer Matches First**: Longer titles take precedence. For example, in the above example, \"Nate River\" is linked,\n  not just \"River.\"\n- **Existing Links Remain**: Pre-existing links in the text are left untouched.\n\nHowever, some words like \"make\" and \"work\" in the example are part of my \"English Words That I Do Not Know\" note. Since\nthey are common and frequently used, I don’t want them to create excessive internal links.\n\n### Excluding Notes from Internal Linking\n\nTo prevent certain notes from being linked:\n\n- Add the tag `#ignoreAutoInternalLink` to a note. This note (and optionally its sub-notes) will be excluded from link\n  creation.\n- You can make it **inheritable**—you can apply it to a parent note and inheritable, then it will be automatically\n  exclude all its sub-notes.\n\nHere’s how it looks after applying the exclusion rule:\n\n![auto-link-3](docs/auto-link-3.webp)\n\nThe result is cleaner and more intentional.\n\n### Special Case: Duplicate Titles\n\nWhen multiple notes share the same title, a specific condition allows for internal links:\n\n- **Direct Sub-Notes Have Priority**: Direct child notes take precedence over other notes with the same title.\n\nFor instance:\n\n![auto-link-4](docs/auto-link-4.webp)\n\nIn this case, the note `TriliumNext` links \"How to compile\" to its own child note, not the one from `Trilium`.\n\n### Final Rule: No Self-Linking\n\nA note will never create an internal link to itself.\n\n---\n\n### Code Samples\n\n**Add an internal link to a specific note by its ID:**\n\n```python\nauto_create_internal_link('gLmmsIM8yPqx')\n```\n\n**Add internal links for multiple notes:**\n\n```python\nauto_create_internal_link(target_notes=['gLmmsIM8yPqx', 'T4Ui3wNByO03'])\n```\n\n**(Experimental - Use with Caution)**  \n**Add internal links to all text notes:**\n\nThis is an experimental feature. **Backup your database** before using it, as it may irreversibly modify your notes. If\nissues occur, please provide a minimal note sample to help debug.\n\n```python\nauto_create_internal_link(process_all_notes=True)\n```\n\n## (Advanced Usage) 📝🌳 Traverse Note Tree\n\nFetch a note's title and content along with its descendants'. Great for reassembling large notes split into smaller child notes.\n\nThe method can be `bfs` or `dfs`.\n```python\nres = ea.traverse_note_tree('XdOlGz7MeYWC', depth=3, limit=100, method='bfs')\nfor x in res:\n    logger.info(x)\n```\n\n## (Basic) Web API Usage\n\nThese features are made based on the web API from Trilium's web client. Be sure you have done the [initialization](#web-api-initialization) before use it.\n\n### 📣 Share note \u0026 cancel share note\n\n```\nwa.share_note('your_note_id')\nwa.cancel_share_note('RfhYrtyQLU8o')\n```\n\n## 🛠️ Develop\n\nInstall with pip egg link to make package change without reinstall.\n\n```python\npython -m pip install --user -e .\n```\n\n## 🔗 Original OpenAPI Documentation\n\nThe original OpenAPI document is [here](https://github.com/zadam/trilium/blob/master/src/etapi/etapi.openapi.yaml). You\ncan open it with [swagger editor](https://editor.swagger.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnriver%2Ftrilium-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnriver%2Ftrilium-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnriver%2Ftrilium-py/lists"}