aboutsummaryrefslogtreecommitdiff
path: root/src/ee/digikey
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-10-22 09:43:54 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-10-22 09:43:54 +0200
commit826a0eb82cc786d480888f3a032df95447c133b8 (patch)
treee8db0701756bf23283316ef04f13f364e37af6c2 /src/ee/digikey
parent0073712b71ea642edc2b67ad64a09cc0f54a137f (diff)
downloadee-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/digikey')
-rw-r--r--src/ee/digikey/__init__.py5
1 files changed, 4 insertions, 1 deletions
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"])