Code Monkey home page Code Monkey logo

digikey-barcode-reader's Introduction

Digikey barcode reader

https://travis-ci.org/claudyus/digikey-barcode-reader.svg?branch=master https://coveralls.io/repos/claudyus/digikey-barcode-reader/badge.svg?branch=master&service=github

A python script to retrieve information about electronic components using bag barcode.

Usage

Scan your digikey/mouser part barcode using a barcode scanner and save it in a text file, the barcodes should be saved one-per-line. See test/test.txt for an input file example.

Than pipe the scanned file to digi-reader.py (linux):

cat input_file.txt | python digi-reader.py >> output.csv

Windows usage:

type input_file.txt | python digi-reader.py >> output.csv

This will output a CSV in the format:

provider, provider pn, manufacter pn, full description[, extra provider specific info]

Background of this script

Often I have to organize bags of digikey parts bought over the time. I have around 200 bags of parts around that should be classify. I start to look at the barcode always present on the bag label [1] and I start to thought about it format, unfortunately nothing can be found online so after a while I was able to recognize a pattern inside the barcode. The first 7 digits are the product_id (used internally by digikey, it is not the p/n), the following digits are the shipped quantity, and the last 6 digits are still unknown (package information? or shipping information?)

On digikey website there is no way, as I know, to retrieve part information using the unique product_id, it is only exposed as part of the URI on the webpage related to a given part.

So I start to write a simple web scraper that is looking for a given product_id, retrieve the digikey page from startpage.com (google cannot be used due to bot recognition system), than open the digikey page and retrieve information about the electronic parts. Than all the infos are printed as CSV.

ATM there is no configuration, you can easily modify the output format at the end of the script itself.

  1. here an example http://ch00ftech.com/wp-content/uploads/2013/02/IMG_1777.jpg

Extra

I will be happy to accept any improvments.

LICENSE

This work is release under BEER-WARE LICENSE

digikey-barcode-reader's People

Contributors

claudyus avatar twam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.