Skip to content

Instantly share code, notes, and snippets.

View soof-golan's full-sized avatar

Soof Golan soof-golan

View GitHub Profile
@SonOfLilit
SonOfLilit / demux.py
Created October 30, 2024 16:49
Split text file by filename/path comments (e.g. for writing LLM outputs to disk)
import sys
import os
from typing import Dict
import re
def parse_files(content: str) -> Dict[str, str]:
"""Parse the input content into a dictionary of filepath -> content."""
files = {}
maybe_files = set()
current_file = None