← Back to team overview

kicad-developers team mailing list archive

Re: Footprint Wizard Farnell/Eagle.scr/Ultra librarian, and scripting, how to integrate

 

I think almost everything could be done with python libraries, no extra
deps:

For https fetching  (https it's mandatory for the api):
http://docs.python.org/library/httplib.html

For json: use integrated python libraries:
http://docs.python.org/library/json.html?highlight=json

For ZIP: http://docs.python.org/library/zipfile.html?highlight=zip#zipfile

Parsing the file: http://theory.stanford.edu/~amitp/yapps/ or any other
grammar compiler.




2012/8/7 Miguel Angel Ajo Pelayo <miguelangel@xxxxxxx>

> Got it!
>
> for this :
> http://es.farnell.com/texas-instruments/tle2426cd/virtual-ground-reference-smd-2426/dp/8454809
>
>
>
> https://api.element14.com//catalog/products?term=id:8454809&storeInfo.id=uk.farnell.com&resultsSettings.offset=0&resultsSettings.numberOfResults=1&resultsSettings.refinements.filters=&resultsSettings.responseGroup=large&callInfo.omitXmlSchema=false&callInfo.callback=&callInfo.responseDataFormat=json&callinfo.apiKey=gd8n8b2kxqw6jq5mutsbrvur
>
> And you will get:
>
>
> {"premierFarnellPartNumberReturn":{"numberOfResults":1,"products":[{"sku":"8454809","displayName":"TEXAS
> INSTRUMENTS - TLE2426CD - VIRTUAL GROUND REFERENCE, SMD,
> 2426","productStatus":"defaultStatus","rohsStatusCode":"YES","packSize":1,"unitOfMeasure":"EACH","id":"pf_UK1_8454809_0","image":{"baseName":"/42268233.jpg","vrntPath":"farnell/"},"datasheets":[{"type":"L","description":"Simulation
> Model","url":"http://www.ti.com/litv/zip/slfj004"},{"type":"T","description":"Technical
> Data Sheet","url":"http://www.ti.com/lit/ds/symlink/tle2426.pdf"},*{"type":"X","description":"CAD
> CadSoft_EAGLE","url":"http://www.farnell.com/cad/1619323.zip"}*],"prices":[{"to":9,"from":1,"cost":0.67},{"to":99,"from":10,"cost":0.57},{"to":1000000000,"from":100,"cost":0.54}],"inv":859,"vendorId":"81415","vendorName":"TEXAS
> INSTRUMENTS","brandName":"TEXAS
> INSTRUMENTS","translatedManufacturerPartNumber":"TLE2426CD","translatedMinimumOrderQuality":1,"attributes":[{"attributeLabel":"
> IC Function","attributeValue":"Precision Virtual
> Ground"},{"attributeLabel":" Brief Features","attributeValue":"Combination
> of Micropower Operational Amplifier & Precision Trimmed Divider on a Single
> Silicon Chip"},{"attributeLabel":" Supply Voltage
> Range","attributeUnit":"V","attributeValue":"4V to 40"},{"attributeLabel":"
> Operating Temperature Range","attributeUnit":"°C","attributeValue":"0°C to
> +70"},{"attributeLabel":" Digital IC Case
> Style","attributeValue":"SOIC"},{"attributeLabel":" No. of
> Pins","attributeValue":"8"},{"attributeLabel":" SVHC","attributeValue":"No
> SVHC (18-Jun-2012)"},{"attributeLabel":" Base
> Number","attributeValue":"2426"},{"attributeLabel":" IC
> Function","attributeValue":"Virtual Ground IC"},{"attributeLabel":" IC
> Generic Number","attributeValue":"2426"},{"attributeLabel":" Operating
> Temperature
> Max","attributeUnit":"°C","attributeValue":"125"},{"attributeLabel":"
> Operating Temperature
> Min","attributeUnit":"°C","attributeValue":"-55"},{"attributeLabel":"
> Package / Case","attributeValue":"SOIC"},{"attributeLabel":" Supply Voltage
> Max","attributeUnit":"V","attributeValue":"40"},{"attributeLabel":" Supply
> Voltage Min","attributeUnit":"V","attributeValue":"4"},{"attributeLabel":"
> Termination
> Type","attributeValue":"SMD"}],"related":{"containAlternatives":false,"containcontainRoHSAlternatives":false,"containAccessories":true,"containcontainRoHSAccessories":true},"stock":{"level":859,"leastLeadTime":42,"status":1,"shipsFromMultipleWarehouses":true,"breakdown":[{"inv":480,"region":"Liege","lead":0,"warehouse":"LG1"},{"inv":379,"region":"UK","lead":42,"warehouse":"GB1"}],"regionalBreakdown":[{"level":480,"leastLeadTime":0,"status":1,"warehouse":"Liege","shipsFromMultipleWarehouses":true},{"level":379,"leastLeadTime":42,"status":1,"warehouse":"UK","shipsFromMultipleWarehouses":true}],"nominatedWarehouseDetails":null},"translatedPrimaryCatalogPage":"521","countryOfOrigin":"TW","comingSoon":false,"publishingModule":"en/624810.xml","vatHandlingCode":"SLST","releaseStatusCode":-1,"isSpecialOrder":false,"isAwaitingRelease":false,"reeling":false,"discountReason":0,"brandId":"1001023","commodityClassCode":"043055000"}]}}
>
>
>
>
> 2012/8/7 Miguel Angel Ajo Pelayo <miguelangel@xxxxxxx>
> >
> > Edwin, can you post a couple of links to farnell parts that have the
> ultralibrarian file?, I cannot find any :)
> >
> >
> > 2012/8/6 Miguel Angel Ajo Pelayo <miguelangel@xxxxxxx>
> >>
> >> Hi Edwin, some kind of REST api would be perfect, I've just found they
> have this:
> >>
> >>
> http://partner.element14.com/docs/read/Product_Search_API_REST_Characteristics
> >>
> >> But not sure if it provides the link or directions to get to the .zip
> file,  and they require you to register an api key (depending on license it
> could be included in the script).
> >>
> >> Other way would be to fetch the http for the part itself, and then
> parse the HTML finding out the .zip file with the footprint description.
> >>
> >>
> >> Cheers,
> >> Mike.
> >>
> >> 2012/8/6 Edwin van den Oetelaar <oetelaar.automatisering@xxxxxxxxx>
> >>>
> >>> Hello everyone,
> >>>
> >>> Short summary.
> >>> I have been working with Miguel behind the scenes trying to get
> scripting fully integrated.
> >>> One of the first thing we can do with scripting is generating
> foot-prints.
> >>> Miguel already has an example working. (parametric footprint)
> >>> Since the Farnell/Element14 website recently is making footprints
> available as eagle.scr files I would like
> >>> to integrate that into the wizard.
> >>> Some things are easy: getting a file from their website, like
> http://www.farnell.com/cad/1550314.zip
> >>> Parsing this will not be hard, just some work.
> >>>
> >>> ** I do have a problem: how to get from an order code : 1885120 on
> farnell to the number 1550314. **
> >>>
> >>> Once we have the zip file, the order code is easily found, since it is
> in the zip file:
> >>>
> >>> Attribute OC_NEWARK '41T0725';
> >>> Attribute OC_FARNELL '1885120';
> >>>
> >>> Any thoughts or experience you want to share?
> >>>
> >>> Thanks,
> >>> Edwin van den Oetelaar
> >>>
> >>> _______________________________________________
> >>> Mailing list: https://launchpad.net/~kicad-developers
> >>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>> More help   : https://help.launchpad.net/ListHelp
> >>>
> >>
> >>
> >>
> >> --
> >>
> >> Miguel Angel Ajo Pelayo
> >> http://www.nbee.es
> >> +34 636 52 25 69
> >> skype: ajoajoajo
> >
> >
> >
> >
> > --
> >
> > Miguel Angel Ajo Pelayo
> > http://www.nbee.es
> > +34 636 52 25 69
> > skype: ajoajoajo
>
>
>
>
> --
>
> Miguel Angel Ajo Pelayo
> http://www.nbee.es
> +34 636 52 25 69
> skype: ajoajoajo
>



-- 

Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 636 52 25 69
skype: ajoajoajo

Follow ups

References