# MdXLogseqTODOSync
A Python tool to synchronize TODO items between Markdown and Logseq files. It allows you to maintain TODO lists across different markdown formats while respecting delimiters and filtering based on patterns and bullet point levels.
I made this so that updating my [logseq](https://github.com/logseq/logseq) graph's TODOs about a given repository would update the README.md of said repository.
## Features
- Synchronize TODO items between different markdown files
- Configurable delimiters to mark sync boundaries
- Filter content based on regular expression patterns
- Control maximum bullet point depth
- Preserves formatting and indentation
- Type-safe implementation with beartype
## Getting started
* From pypi:
* As a tool: `uvx MdXLogseqTODOSync@latest --help`
* Via uv: `uv pip install MdXLogseqTODOSync`
* Via pip: `pip install MdXLogseqTODOSync`
* From github:
* Clone this repo then `pip install .`
## Usage
The tool is primarily used from the command line:
```bash
MdXLogseqTODOSync --help
# Basic usage
MdXLogseqTODOSync input.md output.md
# With filtering options
MdXLogseqTODOSync --must_match_regex "TODO|DONE" --bulletpoint-max-level 2 input.md output.md
# Full options
MdXLogseqTODOSync \
--input-delim-start "- BEGIN_TODO" \
--input-delim-end "- END_TODO" \
--output-delim-start "<!-- BEGIN_TODO -->" \
--output-delim-end "<!-- END_TODO -->" \
--must_match_regex "TODO|DONE" \
--bulletpoint-max-level 2 \
--sub-pattern '(\s*)- (TODO|DONE|DOING|NOW|LATER) ' '\\1- ' \
--remove-block-properties \
--keep-new-lines \
--recursive \
input.md output.md
```
### Configuration Options
- `input_file`: Path or string pointing to the input Markdown/Logseq file
- `output_file`: Path or string pointing to the output Markdown/Logseq file
- `input_delim_start`: Regex pattern to match the start of input section. Use "__START__" for beginning of file. Default: `"__START__"`
- `input_delim_end`: Regex pattern to match the end of input section. Use "__END__" for end of file. Default: `"__END__"`
- `output_delim_start`: Regex pattern to match the start of output section. Default: `"<!-- BEGIN_TODO -->"`
- `output_delim_end`: Regex pattern to match the end of output section. Default: `"<!-- END_TODO -->"`
- `bulletpoint_max_level`: Maximum level of bullet points to process. Use -1 for unlimited. Default: `-1`
- `must_match_regex`: Regex pattern that lines must match to be included. Default: `r"^\s*- (TODO|DONE|DOING|NOW|LATER|#+) "`
- `sub_pattern`: Optional tuple of (search pattern, replace pattern) to modify matched lines. Default: `(r"^(\s*)- (TODO|DONE|DOING|NOW|LATER) ", r"\1- ")`
- `remove_block_properties`: If True, removes Logseq block properties. Default: `True`
- `keep_new_lines`: If True, preserves newlines from Logseq. Default: `True`
- `recursive`: If True, processes nested TODO items under a matching parent. Default: `True`
### File Format
Input file example:
```markdown
Some content...
- BEGIN_TODO
- TODO Review pull request
- DONE Update tests
- TODO Add documentation
- END_TODO
More content...
```
Output file example:
```markdown
# Project TODOs
<!-- BEGIN_TODO -->
- TODO Review pull request
- DONE Update tests
- TODO Add documentation
<!-- END_TODO -->
```
## Error Handling
The tool includes robust error checking for:
- Missing or duplicate delimiters
- Non-existent input files
- Empty or invalid content blocks
- Invalid regex patterns
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
See LICENSE.md file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/thiswillbeyourgithub/MdXLogseqTODOSync",
"name": "MdXLogseqTODOSync",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "logseq, todo, list, markdown, md, organization, productivity",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/9e/2b/d8e617375a53718bacabc8b215c72c16cb4838bedf8c11ef0d1d85842df7/mdxlogseqtodosync-0.0.18.tar.gz",
"platform": null,
"description": "# MdXLogseqTODOSync\n\nA Python tool to synchronize TODO items between Markdown and Logseq files. It allows you to maintain TODO lists across different markdown formats while respecting delimiters and filtering based on patterns and bullet point levels.\n\nI made this so that updating my [logseq](https://github.com/logseq/logseq) graph's TODOs about a given repository would update the README.md of said repository.\n\n## Features\n\n- Synchronize TODO items between different markdown files\n- Configurable delimiters to mark sync boundaries\n- Filter content based on regular expression patterns\n- Control maximum bullet point depth\n- Preserves formatting and indentation\n- Type-safe implementation with beartype\n\n## Getting started\n* From pypi:\n * As a tool: `uvx MdXLogseqTODOSync@latest --help`\n * Via uv: `uv pip install MdXLogseqTODOSync`\n * Via pip: `pip install MdXLogseqTODOSync`\n* From github:\n * Clone this repo then `pip install .`\n\n## Usage\n\nThe tool is primarily used from the command line:\n\n```bash\nMdXLogseqTODOSync --help\n\n# Basic usage\nMdXLogseqTODOSync input.md output.md\n\n# With filtering options\nMdXLogseqTODOSync --must_match_regex \"TODO|DONE\" --bulletpoint-max-level 2 input.md output.md\n\n# Full options\nMdXLogseqTODOSync \\\n --input-delim-start \"- BEGIN_TODO\" \\\n --input-delim-end \"- END_TODO\" \\\n --output-delim-start \"<!-- BEGIN_TODO -->\" \\\n --output-delim-end \"<!-- END_TODO -->\" \\\n --must_match_regex \"TODO|DONE\" \\\n --bulletpoint-max-level 2 \\\n --sub-pattern '(\\s*)- (TODO|DONE|DOING|NOW|LATER) ' '\\\\1- ' \\\n --remove-block-properties \\\n --keep-new-lines \\\n --recursive \\\n input.md output.md\n```\n\n### Configuration Options\n\n- `input_file`: Path or string pointing to the input Markdown/Logseq file\n- `output_file`: Path or string pointing to the output Markdown/Logseq file\n- `input_delim_start`: Regex pattern to match the start of input section. Use \"__START__\" for beginning of file. Default: `\"__START__\"`\n- `input_delim_end`: Regex pattern to match the end of input section. Use \"__END__\" for end of file. Default: `\"__END__\"`\n- `output_delim_start`: Regex pattern to match the start of output section. Default: `\"<!-- BEGIN_TODO -->\"`\n- `output_delim_end`: Regex pattern to match the end of output section. Default: `\"<!-- END_TODO -->\"`\n- `bulletpoint_max_level`: Maximum level of bullet points to process. Use -1 for unlimited. Default: `-1`\n- `must_match_regex`: Regex pattern that lines must match to be included. Default: `r\"^\\s*- (TODO|DONE|DOING|NOW|LATER|#+) \"`\n- `sub_pattern`: Optional tuple of (search pattern, replace pattern) to modify matched lines. Default: `(r\"^(\\s*)- (TODO|DONE|DOING|NOW|LATER) \", r\"\\1- \")`\n- `remove_block_properties`: If True, removes Logseq block properties. Default: `True`\n- `keep_new_lines`: If True, preserves newlines from Logseq. Default: `True`\n- `recursive`: If True, processes nested TODO items under a matching parent. Default: `True`\n\n### File Format\n\nInput file example:\n```markdown\nSome content...\n\n- BEGIN_TODO\n- TODO Review pull request\n - DONE Update tests\n - TODO Add documentation\n- END_TODO\n\nMore content...\n```\n\nOutput file example:\n```markdown\n# Project TODOs\n\n<!-- BEGIN_TODO -->\n- TODO Review pull request\n - DONE Update tests\n - TODO Add documentation\n<!-- END_TODO -->\n```\n\n## Error Handling\n\nThe tool includes robust error checking for:\n- Missing or duplicate delimiters\n- Non-existent input files\n- Empty or invalid content blocks\n- Invalid regex patterns\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nSee LICENSE.md file for details.\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Script to always sync a Logseq TODO list with a markdown file",
"version": "0.0.18",
"project_urls": {
"Homepage": "https://github.com/thiswillbeyourgithub/MdXLogseqTODOSync"
},
"split_keywords": [
"logseq",
" todo",
" list",
" markdown",
" md",
" organization",
" productivity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f9d0d331d8bd9cd6836cff037ec7ec1aa54e0d260ec067ecf383b275843d7b00",
"md5": "4c210c38bd95553c1d0afecd278860c1",
"sha256": "3b1c09cb2b5279e7b00f533fdffdbd61e49fbc0e101a843d9e78e79cefe3d181"
},
"downloads": -1,
"filename": "MdXLogseqTODOSync-0.0.18-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c210c38bd95553c1d0afecd278860c1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 19659,
"upload_time": "2024-12-18T16:51:33",
"upload_time_iso_8601": "2024-12-18T16:51:33.567541Z",
"url": "https://files.pythonhosted.org/packages/f9/d0/d331d8bd9cd6836cff037ec7ec1aa54e0d260ec067ecf383b275843d7b00/MdXLogseqTODOSync-0.0.18-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9e2bd8e617375a53718bacabc8b215c72c16cb4838bedf8c11ef0d1d85842df7",
"md5": "bf97a23df6aaf89a07845a75720c1209",
"sha256": "b538fc2d42edae3b1ab23eb582e1dc06c3a0ada692fdaa3f2d7903b046248ac3"
},
"downloads": -1,
"filename": "mdxlogseqtodosync-0.0.18.tar.gz",
"has_sig": false,
"md5_digest": "bf97a23df6aaf89a07845a75720c1209",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 19237,
"upload_time": "2024-12-18T16:51:45",
"upload_time_iso_8601": "2024-12-18T16:51:45.826998Z",
"url": "https://files.pythonhosted.org/packages/9e/2b/d8e617375a53718bacabc8b215c72c16cb4838bedf8c11ef0d1d85842df7/mdxlogseqtodosync-0.0.18.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 16:51:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thiswillbeyourgithub",
"github_project": "MdXLogseqTODOSync",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mdxlogseqtodosync"
}