import qrcode -- QRcodes in Pythonista
Do you think it is possible to import the zbar library in a further release or Pythonista ?
Zbar already exists on iOS and there are some wrappers in Python.
We could script a QRCode decoder for example with camera input directly in Pythonista.
Or if somebody knows a pure Python QRCode decoder, I would be very very very happy but unfortunately I don't think it exists...
Got one dollar to spare? This might be easier than you think.
Say a bit more about your use case...
Especially, do you want to scan barcodes that <b>you create</b> or do you want to scan preexisting barcodes? If you are creating your own barcodes, you should be able to get ZBar to automatically launch your own Pythonista scripts for free using the Pythonista URL Scheme. See: http://omz-software.com/pythonista/docs/ios/urlscheme.html
You should also push the ZBar community to adopt a zbar:// style for launching their app so that you can launch ZBar directly from Safari or your Pythonista scripts. See: http://x-callback-url.com , http://handleopenurl.com , http://handleopenurl.com/search?scheme=bar -- This last one makes it seem like other barcode apps for iOS already have handleopenurl capabilities that you might want to play with.
<b>Scanner Go</b> http://ilevelupapps.com/scanner-go might be a great place to start your search as it is <b>built on the ZBar engine and already supports the bi-directional x-callback-URL</b>. It will cost you a buck in the iTunes Store but that is cheap.
import webbrowser; webbrowser.open('ilu://')
will cause Pythonista to launch Scanner Go. See: http://ilevelupapps.com/scanner-go/scanner-go-protocol for getting Scanner Go to automatically pass the resulting barcode data back into your Pythonista script.
An even better (round trip) solution using the free <b>pic2shop</b> app... http://omz-forums.appspot.com/pythonista/post/6306197401501696
Hello guys and thank you for your answers !
I am a little bit late :-)
I need to give a mobile phone to un-tech people. They will use it to perform a PC hardware replacement. They will scan the defect PC with the new one. The app will then send informations to a REST API with both serial informations to swap hardwares. No more mistakes...
I need a really simple app for dummies. Instead of coding this app in Objective C, I would play with Pythonista and do it with.
Using callbacks will be too touchy for the target users but it is a good proof of concept before coding the full iOS App. I will try this !!!
Thank you very much.
Check out the pic2shop solution above... To me it looks like you could build an Pythonista app around it (see Hvmhvm's code in the post above) that does everything that you are looking for. It is simple to use even for non-techies and it is a free download from the AppStore.
I hope a built-in integration of barcode and QR code scanning (with zbar) in Pythonista will come soon. I am working on a bitcoin wallet app, which requires QR scanning. It would be nice indeed if we would just import zbar and do everything in Python.
It seems that iOS 7 even has built-in support for QR code scanning according to this article: http://www.appcoda.com/qr-code-ios-programming-tutorial/
The roundtrip with pic2shop works today. Why wait??
The pic2shop trick works but if you want to create a standalone app, that's not an option.
Can I use pic2shop for QR Code scanning? or its just for barcode?
I realize that implementing new features in Pythonista can be far from trivial. However, since iOS7-onward supports barcode/UPC/QR code scanning, I'd like to chime in with a request as well -- if the AVCaptureMetaDataOutput option could be supported as part of an AVCaptureSession, that would (presumably) give Pythonista the ability to natively scan QRcodes and such. I don't know the level of effort required to bridge arbitrary iOS API calls, but native barcode/QR code scanning would be extremely useful.
[I've also used the method of having a scanning app (CNS Barcode) communicate with Pythonista via launch URL schemes, but it is a bit cumbersome and creates an additional dependency when trying to deploy to other devices]
In the current Pythonista you can just
import qrcodeand generate your own qrcodes but... how cool would it be to generate color animated gif qrcodes?!? https://github.com/sylnsfar/qrcode#example-示例