diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-10-22 09:43:54 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-10-22 09:43:54 +0200 |
commit | 826a0eb82cc786d480888f3a032df95447c133b8 (patch) | |
tree | e8db0701756bf23283316ef04f13f364e37af6c2 /src/ee/kicad/__init__.py | |
parent | 0073712b71ea642edc2b67ad64a09cc0f54a137f (diff) | |
download | ee-python-826a0eb82cc786d480888f3a032df95447c133b8.tar.gz ee-python-826a0eb82cc786d480888f3a032df95447c133b8.tar.bz2 ee-python-826a0eb82cc786d480888f3a032df95447c133b8.tar.xz ee-python-826a0eb82cc786d480888f3a032df95447c133b8.zip |
digikey.to_pandas(): Make sure that 'Digi-Key', 'MPN' and 'URL' fields
always are in the data frame.
kicad.to_pandas(): support Schematics objects too.
read_schematics(): Support hierarchical labels.
Diffstat (limited to 'src/ee/kicad/__init__.py')
-rw-r--r-- | src/ee/kicad/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ee/kicad/__init__.py b/src/ee/kicad/__init__.py index 1aac33d..1261cb5 100644 --- a/src/ee/kicad/__init__.py +++ b/src/ee/kicad/__init__.py @@ -27,6 +27,11 @@ def to_pandas(obj: Any, **kwarg): return False return True + def to_pandas_schematics(ss: Schematics): + dfs = [to_pandas_schematic(schematic) for schematic in ss.schematics] + + return pandas.concat(dfs) + def to_pandas_schematic(sch: Schematic): # These fields will always be put first. special_fields = ["ref", "ref_type", "ref_num", "value", "footprint"] @@ -64,5 +69,7 @@ def to_pandas(obj: Any, **kwarg): if isinstance(obj, Schematic): return to_pandas_schematic(obj) + elif isinstance(obj, Schematics): + return to_pandas_schematics(obj) else: raise EeException("Unsupported type: {}".format(type(obj))) |