skidl.scripts.part_search_cli module¶
Command-line interface to search SKiDL part libraries.
This script uses the PartSearchDB to load libraries from paths configured in the user’s .skidlcfg (via skidl.lib_search_paths) and search for parts matching the given query terms. All output is plain text with customizable formatting and field selection.
- skidl.scripts.part_search_cli.format_part(part, format_string)[source]¶
Format a single part using the provided format string.
- Parameters:
part – PartResult namedtuple with part information
format_string – Python format string with field placeholders
- Returns:
Formatted part information
- Return type:
- skidl.scripts.part_search_cli.interactive_browse(db, parts, args, field_list, format_string)[source]¶
Browse through search results with arrow keys and display part details.
- Parameters:
db – PartSearchDB instance
parts – List of PartResult objects from search
args – Parsed command line arguments
field_list – List of fields to display
format_string – Format string for output
- skidl.scripts.part_search_cli.interactive_search(db, args, field_list, format_string)[source]¶
Run interactive search mode with command history support.
- Parameters:
db – PartSearchDB instance
args – Parsed command line arguments
field_list – List of fields to display
format_string – Format string for output
- skidl.scripts.part_search_cli.perform_search_and_display(db, search_terms, args, field_list, format_string)[source]¶
Perform search and display results based on current arguments.
- Parameters:
db – PartSearchDB instance
search_terms – Search query string
args – Parsed command line arguments
field_list – List of fields to display
format_string – Format string for output
- Returns:
Number of results found
- Return type:
