python电子零件工具
pyparts的Python项目详细描述
从agregators获取有关零件信息的实用程序。
你可以在 https://github.com/guyzmo/pyparts
用法
Usage: pyparts.py [-k <apikey>] [-t <target>] [-c <config>] [--help] [--version] [--verbose] <command> [<args>...] Options: -k <apikey> Gives apikey -t <target> Selects agregator. [default: octopart] -c --config <conf> Use configuration file. [default: ~/.config/pyparts.cfg] -h --help Show this screen. --version Show version. --verbose Show more details. Commands: lookup Search part specs Get specs for a part datasheet Download part's datasheet open Open part's page in browser help Give help for a command See `pyparts.py help <command>` to get more information on a command
示例
下面您将看到该工具的一些使用示例
查找零件
% bin/pyparts lookup 'atmega 2560' Searched for: 'atmega 2560' → ATMEGA2560-16AU Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 5v 100-pin tqfp → ATMEGA2560V8AU Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA1284P-PU Atmel mcu, 8bit, <strong>atmega</strong>, 20mhz, dip-40... atmel <strong>atmega</strong>-avr- pdip-40 → ATSTK600 Atmel ers a quick start into the world of <strong>atmegas</strong> xmegas and design of new application → ATMEGA2560V-8CU Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA2560-16AUR Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 5v 100-pin tqfp → ATMEGA2560V-8AUR Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA2560-16CU Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 5v 100-pin cbga → ATMEGA2560-16AI Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8CUR Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA2560V-8AI Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560-16AU Adesto Technologies 8bit mcu, 256k flash, 5v, smd, <strong>2560</strong>; timers, no. of:6; bits, no. of:8; fre → ATMEGA2560-16CUR Atmel mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 5v 100-pin cbga → ATMEGA2560R231-AU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560R212-AU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560R212-CU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560R231-CU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8AU Adesto Technologies mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA256016AU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8CU Adesto Technologies mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 2.5v/3.3v/5v 100 → ATMEGA2560-16CU Adesto Technologies mcu 8-bit <strong>atmega</strong> avr risc 256kb flash 5v 100-pin cbga → ATSTK600-ATMEGA2560 Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560 Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8AU-RET Atmel manufacturer alias: <strong>atmega</strong> → D2560AJ Atmel manufacturer alias: <strong>atmega</strong> → ATTD2560AD Atmel manufacturer alias: <strong>atmega</strong> → 2560R03510D Atmel manufacturer alias: <strong>atmega</strong> → MCU CARD ATMEGA2560 mikroElektronika Board: multiadapter; ATMEGA2560; In the set: prototype → 2560-16AU Atmel manufacturer alias: <strong>atmega</strong> → 2560V-8AU Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-W 11 Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8AI TE Connectivity None → ATMEGA2560-16AI TE Connectivity None → ATMEGA2560V-8CUR TE Connectivity None → ATMEGA2560V-8AUR TE Connectivity None → ATMEGA2560R212-AU TE Connectivity None → ATMEGA2560-16CUR TE Connectivity None → ATMEGA2560R212-CU TE Connectivity None → ATMEGA2560R231-AU TE Connectivity None → ATMEGA2560R231-CU TE Connectivity None → ATMEGA2560-16AUR TE Connectivity None → ATMEGA2560-16AU SL383 Atmel manufacturer alias: <strong>atmega</strong> → ATMEGA2560V-8AU SL383 Atmel manufacturer alias: <strong>atmega</strong> → ATSTK600-ATMEGA2560 TE Connectivity None
获取给定零件产品名称的规格
% bin/pyparts specs ATMEGA2560-16AUR Showing specs for 'ATMEGA2560-16AUR': → Manufacturer: Atmel → Specifications: → Number of Pins : 100 → Supply Voltage (DC) : (V) min: 4.5 → Clock Speed : 16000000.0 (Hz) → RoHS : Compliant → RAM Memory Size : 8192 (byte) → URI: http://octopart.com/atmega2560-16aur-atmel-18611869 → Datasheets → URL: http://datasheet.octopart.com/ATMEGA2560-16AUR-Atmel-datasheet-13399453.pdf → Updated: 2012-10-04T12:50:24Z → Nb Pages: 447 → URL: http://datasheet.octopart.com/ATMEGA2560-16AUR-Atmel-datasheet-5357710.pdf → Updated: 2007-08-23T10:58:35Z → Nb Pages: 448
下载给定零件产品名
的数据表% bin/pyparts datasheet ATMEGA2560-16AUR save --output . Downloading datasheet for 'ATMEGA2560-16AUR': [------------------------------------------------------------------------------------>] Datasheet file saved as ./ATMEGA2560-16AUR-ATMEGA2560-16AUR-Atmel-datasheet-13399453.pdf. [------------------------------------------------------------------------------------>] Datasheet file saved as ./ATMEGA2560-16AUR-ATMEGA2560-16AUR-Atmel-datasheet-5357710.pdf.
在浏览器中打开部件的网页
% bin/pyparts show ATMEGA2560-16AUR Opening page for part 'ATMEGA2560-16AUR'.
安装
该实用程序只与python3兼容!
只要做:
python3 setup.py install
它将作为shell命令提供:
% pyparts -h
当工具被认为足够稳定时,我会将其上载到 pipy:
% pip install pyparts
配置
要使用该工具,需要从octopart获取api密钥 工作。为此,您需要创建一个帐户并连接到 Application registration page 在Octopart上注册一个应用程序(选择你想要的名称和URL)。 从那里你可以复制api密钥,例如'ab12cd45'并使用它 以下方式:
% pyparts -k ab12cd45 lookup 'NE555'
或者将其存储在配置文件中,以避免在每个 调用工具,默认位置为 ~/.config/pyparts.cfg:
[general] apikey='ab12cd45'
或者如果您想将配置文件存储在其他地方,您可以:
% pyparts -c ~/.pyparts.cfg lookup 'LM317'
开发
如果您只是想发展,可以这样做:
% buildout
它将下载依赖项并在bin:
中部署cli工具% bin/pyparts
您可以使用以下命令运行回归测试:
% bin/test
路线图
- []其他聚合器支持
- []材料支持清单
- []优惠/定价支持
- []添加测试
- [X]配置文件支持
- [X]Octopart支持
- [X]基本cli api的定义
许可证
在GPLv3许可证下
Pyparts, Python utility to lookup and browse parts from commandline Copyright (C)2015, Bernard `Guyzmo` Pratz This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.