README (2127B)
1 ** This repo has been moved ! ** 2 3 I might keep pushing to this github repo, but upstream is now: 4 5 https://git.onna.be/parteye/ 6 7 ---------------------------------------------------------------------------- 8 9 # parteye.py # 10 11 Acts as a glue between [zbar](http://zbar.sourceforge.net/) and 12 [Partkeepr](https://www.partkeepr.org/). 13 A good way of repurpose an old webcam ! 14 15 For now it only works with [TME](https://www.tme.eu/), the polish electronics 16 parts distributor. On their orders, they place a little QR code on each 17 package with some info. With that and the distributor's API ... no need to type 18 anymore ! 19 20 I'll probably extend it to work with [Farnell/Element14](http://farnell.com) if 21 I place an order soon, as they too have a reasonably good API and maybe they do 22 something similar with their packages 23 24 # requirements # 25 26 As far as I know, python3 and [requests 27 ](http://docs.python-requests.org/en/master/) library. 28 29 # usage # 30 31 First configure the thing. Create a file named `config.ini` in the same folder 32 as the script. It should look like this: 33 34 ``` 35 [tme] 36 token = your_tme_api_token 37 secret = your_tme_api_secret 38 39 [partkeepr] 40 user = your_pk_username 41 pwd = your_pk_password 42 url = http://your_pk_url 43 44 ``` 45 46 And then basically, pass the output of zbar to the script via pipe: 47 48 ``` 49 zbarcam --raw /dev/video0 | ./parteye.py 50 ``` 51 52 On [Arch Linux](https://www.archlinux.org/) you may need a little bit of 53 tweaking because of zbar ...: 54 55 ``` 56 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so zbarcam --raw /dev/video0 | ./parteye.py 57 ``` 58 59 # notes # 60 61 The script places the new part under a category at root level named `00 - QR-reader`. 62 For the location uses one named _"Sense-Ordenar"_. 63 You can change that on request.json. 64 65 Partkeepr API doc is literally non-existent ... So if you want to tweak this, 66 you'll have to make good use of _Developer tools_ on your browser. 67 68 # bugs # 69 70 Patches are welcome. 71 If you find any bugs, please contact me: https://onna.be/contact.html 72 73 # license # 74 75 For what it's worth .. this goes under MIT license. 76 77 Beep sound by _kalisemorrison_. Find more [here](https://freesound.org/people/kalisemorrison/)