Skip to main content

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 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:

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:

Some content...

- BEGIN_TODO
- TODO Review pull request
  - DONE Update tests
  - TODO Add documentation
- END_TODO

More content...

Output file example:

# 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.

Release files for MdXLogseqTODOSync 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MdXLogseqTODOSync 0.1.0
File Size Uploaded
mdxlogseqtodosync-0.1.0.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MdXLogseqTODOSync 0.1.0
File Interpreter ABI Platform
MdXLogseqTODOSync-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / mdxlogseqtodosync-0.1.0.tar.gz

Download URL mdxlogseqtodosync-0.1.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
22fd71f917d034a8cac63d4d83b0efe4301a77037e179bbaba0faa8a459d11c3
BLAKE2b-256 checksum
How to use checksums
9ea282f2bdb6464967edad2a071233db016fc8129efb35e9252dbf7ff9e515d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

Release files / MdXLogseqTODOSync-0.1.0-py3-none-any.whl

Download URL MdXLogseqTODOSync-0.1.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79a585ae699c361fbbe16622bfca61c52e37b2744e42edcb977b1c71df64736d
BLAKE2b-256 checksum
How to use checksums
84b85db43aebb4c2428bacb4d58600840fd7c039e5013b0f42347c652856238b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page