Skip to main content

Python electronic parts tool

Project description

Utility to get information about parts from agregators.

You’ll find the sources of the project on https://github.com/guyzmo/pyparts

Usage

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

Example

Below you’ll find a few example usage of the tool

Lookup a part

% 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

Get specification for a given part’s product name

% 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

Download datasheets for a given part’s product name

% 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.

Open the part’s webpage in your browser

% bin/pyparts show ATMEGA2560-16AUR
Opening page for part 'ATMEGA2560-16AUR'.

Install

That utility is only compatible with Python3!

just do:

python3 setup.py install

and it’ll be available as a shell command:

% pyparts -h

when the tool will be considered stable enough, I’ll upload it to pipy:

% pip install pyparts

Configuration

To use the tool you need to get an API key from Octopart for this to work. To do so, you need to create an account and connect to the Application registration page at Octopart and register an app (choose whatever name and url you want). From there you can copy the API key, e.g. ‘ab12cd45’ and use it the following way:

% pyparts -k ab12cd45 lookup 'NE555'

or store it in a config file, to avoid putting the key at each invocation of the tool, default location being ~/.config/pyparts.cfg:

[general]
apikey='ab12cd45'

or if you want to store your config file elsewhere, you can:

% pyparts -c ~/.pyparts.cfg lookup 'LM317'

Development

if you just want to develop, you can do:

% buildout

which will download dependencies and deploy the CLI tool in bin:

% bin/pyparts

You can run regression tests using:

% bin/test

Roadmap

  • [ ] Other aggregator support

  • [ ] Bills of material support

  • [ ] Offers/pricing support

  • [ ] Add tests

  • [x] Configuration file support

  • [x] Octopart support

  • [x] Definition of basic CLI API

Author

Bernard Guyzmo Pratz

License

Under the GPLv3 License

Under the GPLv3 License

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/>.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyparts-0.5.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

pyparts-0.5-py3.4.egg (17.3 kB view details)

Uploaded Source

File details

Details for the file pyparts-0.5.tar.gz.

File metadata

  • Download URL: pyparts-0.5.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyparts-0.5.tar.gz
Algorithm Hash digest
SHA256 5cab1f3bdce7e0a18a21e7fd97a9950fa7d8d48f1b54020713b4c83bb197dd11
MD5 d37bb9c51e82a8dc730b2316cae4d701
BLAKE2b-256 2d2a16445f4bdd0becdd97800a2850065114d12c4af20a8018bb5306d6c495e4

See more details on using hashes here.

File details

Details for the file pyparts-0.5-py3.4.egg.

File metadata

  • Download URL: pyparts-0.5-py3.4.egg
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyparts-0.5-py3.4.egg
Algorithm Hash digest
SHA256 b0e34e06cdf76d7c40823f3eab1c138e26476876e29c227f520acc6bdf7d47ae
MD5 6ee7f2f2d644f9d31506543acd88ecb9
BLAKE2b-256 f2dcc73dfbea9661e1a19da35eb939bf8ca7a9d4859cb336b601f1e9c16bf833

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page