qmd_py.vpath¶
marq://collection/path virtual-path parsing and construction.
vpath ¶
marq://collection/path virtual path parsing - port of the TS
reference qmd's isVirtualPath/parseVirtualPath/buildVirtualPath
(src/store.ts), minus the ?index= query param handling, which was for
the per-project SQLite --index <name> concept the plan drops entirely
(it doesn't apply to a shared Postgres backend).
is_virtual_path ¶
Whether path looks like a virtual path rather than a plain one.
Accepts the bare //collection/path form as well as marq://...,
since shells and editors routinely strip the scheme.
Returns:
-
bool–True for anything starting
marq:or//. A syntactic check -
bool–only - it neither parses the rest nor checks the collection
-
bool–exists.
Source code in src/qmd_py/vpath.py
parse_virtual_path ¶
Split a virtual path into its collection and document path.
Parameters:
-
path(str) –marq://collection/path, or the scheme-less//collection/path.
Returns:
-
tuple[str, str] | None–A
(collection_name, path)pair, or None if it doesn't parse. -
tuple[str, str] | None–The path half is
""for a bare collection reference like -
tuple[str, str] | None–marq://notes/, so callers should expect an empty second element -
tuple[str, str] | None–rather than None.
Source code in src/qmd_py/vpath.py
build_virtual_path ¶
Join a collection and document path into a marq:// URI.
No escaping is applied - see mcp/server.py's _encode_qmd_path()
for the percent-encoded form the MCP resource layer needs.