import argparse from pathlib import Path import ee.tools from ee.digikey.search_parts import search_parts from ee.project import Project parser = argparse.ArgumentParser() ee.tools.add_default_argparse_group(parser) parser.add_argument("--in", dest="in_path", required=True, metavar="PART DB") parser.add_argument("--out", required=True, metavar="PART DB") parser.add_argument("--store", default="us", metavar="STORE CODE") args = parser.parse_args() ee.tools.process_default_argparse_group(args) project = Project.load() cache_dir = project.cache_dir / "digikey" store_code = args.store out_path = Path(args.out) log_path = out_path.parent / (out_path.name.replace(".xml", ".rst")) search_parts(Path(args.in_path), out_path, log_path, cache_dir, store_code)