diff options
Diffstat (limited to 'src/ee/tools/create_bom.py')
-rw-r--r-- | src/ee/tools/create_bom.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ee/tools/create_bom.py b/src/ee/tools/create_bom.py new file mode 100644 index 0000000..19521ce --- /dev/null +++ b/src/ee/tools/create_bom.py @@ -0,0 +1,31 @@ +import argparse +from pathlib import Path + +from ee.bom import create_bom +from ee.project import Project + +parser = argparse.ArgumentParser() + +parser.add_argument("--schematic", + required=True, + metavar="PART DB") + +parser.add_argument("--out", + required=True, + metavar="PART DB") + +parser.add_argument("--part-db", + nargs="*", + required=True, + metavar="PART DB") + +parser.add_argument("--strategy", + metavar="FUNC") + +args = parser.parse_args() + +project = Project.load() +part_db_dirs = [Path(part_db) for part_db in args.part_db] +fail_on_missing_parts = False + +create_bom(project, Path(args.schematic), Path(args.out), part_db_dirs, fail_on_missing_parts, args.strategy) |