Module utils

Module utils 

Source
Expand description

Utility functions for the Memvid CLI

Functions§

apply_lock_cli
Apply lock CLI settings to a memory instance
autodetect_memory_file
Auto-detect a memory file in the current directory
ensure_cli_mutation_allowed
Ensure that CLI mutations are allowed for the given memory
format_bytes
Format bytes in a human-readable format (B, KB, MB, GB, TB)
format_percent
Format a percentage value for display
format_timestamp
Format a Unix timestamp to ISO 8601 string
format_timestamp_ms
Format milliseconds as HH:MM:SS.mmm
frame_status_str
Convert frame status to string representation
looks_like_memory
Check if a string looks like a memory file path
looks_like_memory_path
Check if a path looks like a memory file
open_read_only_mem
Open a memory file in read-only mode
owner_hint_to_json
Convert lock owner hint to JSON format
parse_date_boundary
Parse a date boundary string (YYYY-MM-DD)
parse_size
Parse a size string (e.g., “6MB”, “1.5 GB”) into bytes
parse_timecode
Parse a timecode string (HH:MM:SS or MM:SS or SS) into milliseconds
parse_vector
Parse a comma-separated vector string into f32 values
read_embedding
Read an embedding vector from a file (whitespace-separated float values)
read_payload
Read payload bytes from a file or stdin
round_percent
Round a percentage value to one decimal place
select_frame
Select a frame by ID or URI
yes_no
Convert boolean to “yes” or “no” string