SearchSet
- class SearchSet(searches_list=<factory>)
Bases:
Iterator[Any]Mutable iterator and collection of Search objects.
Attributes
searches_listMethods
add(search)Add a search to the collection.
remove(index)Remove a search by index.
read_json(path)Read a search collection from a JSON file.
write_json([path])Serialize the collection and optionally write it to disk.
to_dicts()Convert all searches to dictionaries.
- Parameters:
searches_list (List[Any])
- index: int = 0
- add(search)
Add a search to the collection.
- Parameters:
search (Any) – Search to append.
self (SearchSet)
- Returns:
None.
- Return type:
None
- remove(index)
Remove a search by index.
- Parameters:
index (int) – Search index to remove.
self (SearchSet)
- Returns:
None.
- Return type:
None
- write_json(path=None)
Serialize the collection and optionally write it to disk.
- Parameters:
path (str | None) – Optional destination file path.
self (SearchSet)
- Returns:
JSON string when no path is supplied, otherwise None.
- Return type:
str | None