From 826a0eb82cc786d480888f3a032df95447c133b8 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 22 Oct 2017 09:43:54 +0200 Subject: 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. --- src/ee/digikey/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ee/digikey') diff --git a/src/ee/digikey/__init__.py b/src/ee/digikey/__init__.py index d1664e2..3341e28 100644 --- a/src/ee/digikey/__init__.py +++ b/src/ee/digikey/__init__.py @@ -2,6 +2,7 @@ import enum from typing import List, Optional from ee.tools import mk_parents +import ee._utils import re import requests import os @@ -376,6 +377,8 @@ class DigikeyRepository(object): def to_pandas(self): import pandas + columns = [] data = [part._to_pandas_dict() for part in self.products] index = [part.mpn for part in self.products] - return pandas.DataFrame(data=data, index=index) + df = pandas.DataFrame(data=data, index=index) + return ee._utils.ensure_has_columns(df, ["MPN", "Digi-Key", "URL"]) -- cgit v1.2.3