From 08b04ded18e8b41818b5f3abb005c22b02f767b8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 15 Oct 2019 15:52:36 +0200 Subject: digikey bom: Adding MPN in addition to SPN. --- src/ee/digikey/bom.py | 3 ++- src/ee/tools/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ee/digikey/bom.py b/src/ee/digikey/bom.py index cb02f05..bf5456c 100644 --- a/src/ee/digikey/bom.py +++ b/src/ee/digikey/bom.py @@ -19,11 +19,12 @@ def create_bom(bom_path: Path, part_files: List[Path], out_path: Path, allow_inc with out_path.open("w") as f: w = csv.writer(f) - w.writerow(["Digi-Key Part Number", "Quantity", "Reference Designator"]) + w.writerow(["Digi-Key Part Number", "Manufacturer Part Number", "Quantity", "Reference Designator"]) for line in bom.lines: line = [ line.part.get_exactly_one_spn().valueProp, + line.part.get_exactly_one_mpn().valueProp, int(ceil(len(line.refs) * quantity)), join_refs(line.refs)] w.writerow([str(cell) for cell in line]) diff --git a/src/ee/tools/__init__.py b/src/ee/tools/__init__.py index 00fee58..1bd4a6c 100644 --- a/src/ee/tools/__init__.py +++ b/src/ee/tools/__init__.py @@ -9,7 +9,8 @@ from ee.logging import log __all__ = [ "mk_parents", "mk_dirs", - "log" # for compatibility, should be removed + "log", # for compatibility, should be removed + "parse_bool", ] -- cgit v1.2.3