{ "info": { "author": "Kirill V. Belyayev", "author_email": "kbelyayev@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# Barcode Capture\n\n## Introduction\nThis code was made to extract any barcode using your web camera.\nAs of now it utilizes `pyzbar` and `pylibdmtx` libraries. Which have their own set of\nrecognizable barcodes. Mainly, we were targeting QR codes and data matrix codes. But it will\nrecognize other popular formats supported by those libraries.\n\nUnder the hood, this code takes each frame from the camera like so\n\n![Web Camera Frame](https://raw.githubusercontent.com/Barmaley13/BarcodeCapture/master/images/barcode1.jpg)\n\nAnd detects barcode if it present.\nAnd finally provides output as a string like so\n```\noutput: Wikipedia, the free encyclopedia\n```\n\nThere is a probability that algorithm will fail during one of those steps. In such case the code will not \nproduce any output. Also, there is a small possibility that the algorithm will provide incorrect output. So keep \nthat in mind while capturing barcodes!\n\n## Requirements\nThis code has been tested on Windows machine. Most likely it will work on alternative OS but we have not\ntested it on any other OS.\n\nOtherwise, you will need:\n\n* Python 3\n* OpenCV 2\n* pyzbar\n* pylibdmtx\n* Web Camera\n\n## Easy installation\nUse pip to install this library, fast and easy!!!\n```bash\npip install barcap\n```\n\n## Manual installation\n### Install libraries\nOn Linux, you have to install some extra packages:\n```bash\nsudo apt-get install libzbar0\nsudo apt-get install libdmtx0a\n```\n\nOn MAC, that be a little different:\n```bash\nbrew install zbar\nbrew install libdmtx\n```\n\nOn Windows, everything should happen automatically. \nIf you have any dll problems, please install \n[Visual C++ Redistributable Packages for Visual Studio 2013](https://www.microsoft.com/en-US/download/details.aspx?id=40784)\nand see if that resolves those issues.\n\n### Install python packages\nYou can install requirements using\n```bash\npip install -r requirements.txt\n```\n\n## Further instructions\nhttps://pypi.org/project/pyzbar/\nhttps://pypi.org/project/pylibdmtx/\n\n\n## Most Basic Barcode Capture\nThis is the simplest way to get you started. Also this is the best way to make sure that your setup works properly.\nSimply run in a shell:\n\n```bash\npython -m barcap\n```\n\nWindow with your default camera is going to pop up and capture algorithm will be running in a while loop.\nIf everything is successful you will see output periodically printed out in the shell.\n\n### Manual Capture\nOnce again start while capture loop by running:\n```\n$ python -m barcap\n```\n\nFirst of all, make sure your capture window is selected.\nOnce, you have a good image in the window with keypad occupying most of the screen press `'s'` key to save this frame.\nOpen `barcode.jpg` and confirm that the frame has been written. Kill the loop by pressing `'q'` or `Esc`.\n\n#### If it does not work...\n* Do you have camera connected?\n* Is computer even on?\n* If nothing helps fix your hardware in the software!\n\nAll jokes aside most likely the libraries do not support this barcode or something wrong with a setup.\n\n### Final Thoughts\nAt this point you probably understand how my routine works so you can try modifying it if things are not working out. \n\nOtherwise, **Congratulations!!! You got it working!!!**\n \n## Importing Barcode Capture into your own python script\nIf you look closely, you will see that capture loop is inside this `BarcodeCapture` class based on `Process` class \nfrom `multiprocessing` module.\n\nHere is how you can take advantage of those in your own script.\n\nTo **create** a capture instance do following:\n```python\nfrom barcap import BarcodeCapture \ncapture = BarcodeCapture(camera=0)\n```\n\nTo **start** capturing process:\n```python\ncapture.start()\n```\n\nTo **stop** capturing process:\n```python\ncapture.stop()\n```\nor\n```python\ncapture.terminate()\n```\n\nTo **check** if capturing is still happening:\n```python\ncapture.is_alive()\n```\n\nTo **read** decoded output:\n```python\noutput = capture.ouput\nprint(f'output: {output}')\n```\n\nTo **fetch** epoch time of the last decoding:\n```python\nimport time\n\nepoch = capture.last_epoch\ntime_stamp = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(epoch))\nprint(f'last capture: {time_stamp}')\n```\n\nYou can also check if **new** output is available\n```python\nif capture.new:\n print(f'output: {capture.output}')\n```\nEvery time you read output it resets the `new` flag.\n\n## Additional Info and Questions\n\nShoot me email at `kirill at kbelyayev.com` if you have any questions, suggestions, improvements, additions and etc.\nI would love to help you with this script if you hire me as a contractor. I might help you free of charge if \nyou contribute to this distribution or ask politely. Beer donations are welcome too!\n\n**Good luck! Happy coding and hacking!**", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Barmaley13/BarcodeCapture", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "barcap", "package_url": "https://pypi.org/project/barcap/", "platform": "", "project_url": "https://pypi.org/project/barcap/", "project_urls": { "Homepage": "https://github.com/Barmaley13/BarcodeCapture" }, "release_url": "https://pypi.org/project/barcap/0.1.12/", "requires_dist": null, "requires_python": ">=3.6.0", "summary": "Extract any barcode using your web camera", "version": "0.1.12" }, "last_serial": 5952334, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "0a63031ae26a3eacd86a0fa81eb8dabc", "sha256": "bad436947e5fbb1600536d6dc171da2fde77e7dce0973702b2eeee1333894ce2" }, "downloads": -1, "filename": "barcap-0.1.10.tar.gz", "has_sig": false, "md5_digest": "0a63031ae26a3eacd86a0fa81eb8dabc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 627126, "upload_time": "2019-09-26T22:11:56", "url": "https://files.pythonhosted.org/packages/e9/fd/4fcfbaa6be545a00b0e78f4579b9d03435855103d2f56a1a06f7e8f4ffbe/barcap-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "0b9b367eaa0693f4667d7f456bcd60fa", "sha256": "af29116276eebf4bba65cf8d165b9987fa4fd2a7739f3cd2c68849bc68d72ffd" }, "downloads": -1, "filename": "barcap-0.1.11-py3.6.egg", "has_sig": false, "md5_digest": "0b9b367eaa0693f4667d7f456bcd60fa", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.6.0", "size": 522743, "upload_time": "2019-09-27T17:26:54", "url": "https://files.pythonhosted.org/packages/f7/09/ecc947bc8a9dc34769e05e3e5ce32782e45f4459fcc5210751a60e40519f/barcap-0.1.11-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "36885f1b698677ad2f87f61b8b0bc856", "sha256": "9e2997811a2431042f65f17b263c96dfae758c3826e55148e6506cc88079d502" }, "downloads": -1, "filename": "barcap-0.1.11.tar.gz", "has_sig": false, "md5_digest": "36885f1b698677ad2f87f61b8b0bc856", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 628237, "upload_time": "2019-09-27T17:26:56", "url": "https://files.pythonhosted.org/packages/44/2b/d59e202952e5e8ba2ccc780ce5bb1ae8376484f422f05e527a99793dec72/barcap-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "667d598c2fd137c9f9a6e0fc46a828ab", "sha256": "fafd953fc1a6b03608e064578d5c186fd042079ab50408f2102c15d09feab4fa" }, "downloads": -1, "filename": "barcap-0.1.12-py3.6-win-amd64.egg", "has_sig": false, "md5_digest": "667d598c2fd137c9f9a6e0fc46a828ab", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.6.0", "size": 541792, "upload_time": "2019-10-09T22:52:33", "url": "https://files.pythonhosted.org/packages/17/2d/15e28f1dcc6d34504a2bf97f5223c811b534b7c724d4c872491d2d6af89d/barcap-0.1.12-py3.6-win-amd64.egg" }, { "comment_text": "", "digests": { "md5": "5031b9b6e1d64ca56137236f69b25b4d", "sha256": "bd06d93a2fb626812a2a9ba01f170bff61ee63e46384e8c69ff467e1a5ea68ee" }, "downloads": -1, "filename": "barcap-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5031b9b6e1d64ca56137236f69b25b4d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 628293, "upload_time": "2019-10-09T22:52:35", "url": "https://files.pythonhosted.org/packages/55/b9/0681f56ccea7cb36540016a61626698a68d6cfeb4c99ceccb050465931b7/barcap-0.1.12.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "b61e27c8bf748eef9f411a3dce58b14d", "sha256": "f0c40e26e71f06853059fcc0b05385317055af03bed4d5b09c646a66e5af65bf" }, "downloads": -1, "filename": "barcap-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b61e27c8bf748eef9f411a3dce58b14d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 624681, "upload_time": "2019-09-26T19:54:37", "url": "https://files.pythonhosted.org/packages/a7/6b/50f01d152591389b872d1c3ff186ab454ba3439d4f85e0891e6f93be595d/barcap-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "413433f68028717d339160cd9038959d", "sha256": "5dd48e34682fe490d6191045c3cf64349c49f0a2fbdf8c2e860c473e2bddf468" }, "downloads": -1, "filename": "barcap-0.1.6-py3.6.egg", "has_sig": false, "md5_digest": "413433f68028717d339160cd9038959d", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 520785, "upload_time": "2019-09-26T20:18:58", "url": "https://files.pythonhosted.org/packages/79/3b/89fb8d5296721776c15c607fc23d2b63150608ec2fd169ec0f6b12fe8163/barcap-0.1.6-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "2cbec59f25b1e2c2d3c06bc0a541943f", "sha256": "1b23b215202bb647a94779fa26c5771179935de6b0b5c71a4086c7f68e28e222" }, "downloads": -1, "filename": "barcap-0.1.6.tar.gz", "has_sig": false, "md5_digest": "2cbec59f25b1e2c2d3c06bc0a541943f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 624985, "upload_time": "2019-09-26T20:19:02", "url": "https://files.pythonhosted.org/packages/5a/4a/2a5d983d32a9ac753b9dc8171500dc872d3bf386c1b790092921205a1e79/barcap-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "f312d85a261aa729afd0ba9746609db5", "sha256": "8111c28d1a49becdf1c8ef7146d62f4ae300004524e021e78a558d27fe7f124c" }, "downloads": -1, "filename": "barcap-0.1.7-py3.6.egg", "has_sig": false, "md5_digest": "f312d85a261aa729afd0ba9746609db5", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 520797, "upload_time": "2019-09-26T21:31:22", "url": "https://files.pythonhosted.org/packages/02/9b/a383abc02de22fa3a9e17a0f5b1fcd77d06134baeba7d29a66200ec8bd04/barcap-0.1.7-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "e7a2fdbee0bd108be6e894fd39d70a92", "sha256": "a758f3c479c99ed90d8fcde8dd6d46162e85462000b93e07434d6f7d5ae4c893" }, "downloads": -1, "filename": "barcap-0.1.7.tar.gz", "has_sig": false, "md5_digest": "e7a2fdbee0bd108be6e894fd39d70a92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 625187, "upload_time": "2019-09-26T20:24:32", "url": "https://files.pythonhosted.org/packages/da/b3/d3e9a9dd54452c78be1da7048bb7a3fa3a211847bb15823a599dcf255a76/barcap-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "7698e935bacb0290529e9a8b4b88d367", "sha256": "4278950ceaa7cef34406c994b2f5ad706b75f62568ab18d4c6230d161ab7d7b7" }, "downloads": -1, "filename": "barcap-0.1.8.tar.gz", "has_sig": false, "md5_digest": "7698e935bacb0290529e9a8b4b88d367", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 625235, "upload_time": "2019-09-26T21:33:21", "url": "https://files.pythonhosted.org/packages/0e/d9/4c02048d0c509d3847e865c7e4a9ffe6ac03913da0b82d54e86df60531c3/barcap-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "b9731100355ed466646f9bb0b06b5949", "sha256": "79cf7dc4f1da08e35aaf48467d144a4664f818a4e163cf6f61873bca0892dcdf" }, "downloads": -1, "filename": "barcap-0.1.9.tar.gz", "has_sig": false, "md5_digest": "b9731100355ed466646f9bb0b06b5949", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 626992, "upload_time": "2019-09-26T22:06:26", "url": "https://files.pythonhosted.org/packages/b2/b7/4a026821c3f5a728e9ce0c45d84cc0c0b5e738b31a0dc536ee3f7e22c5a2/barcap-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "667d598c2fd137c9f9a6e0fc46a828ab", "sha256": "fafd953fc1a6b03608e064578d5c186fd042079ab50408f2102c15d09feab4fa" }, "downloads": -1, "filename": "barcap-0.1.12-py3.6-win-amd64.egg", "has_sig": false, "md5_digest": "667d598c2fd137c9f9a6e0fc46a828ab", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.6.0", "size": 541792, "upload_time": "2019-10-09T22:52:33", "url": "https://files.pythonhosted.org/packages/17/2d/15e28f1dcc6d34504a2bf97f5223c811b534b7c724d4c872491d2d6af89d/barcap-0.1.12-py3.6-win-amd64.egg" }, { "comment_text": "", "digests": { "md5": "5031b9b6e1d64ca56137236f69b25b4d", "sha256": "bd06d93a2fb626812a2a9ba01f170bff61ee63e46384e8c69ff467e1a5ea68ee" }, "downloads": -1, "filename": "barcap-0.1.12.tar.gz", "has_sig": false, "md5_digest": "5031b9b6e1d64ca56137236f69b25b4d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 628293, "upload_time": "2019-10-09T22:52:35", "url": "https://files.pythonhosted.org/packages/55/b9/0681f56ccea7cb36540016a61626698a68d6cfeb4c99ceccb050465931b7/barcap-0.1.12.tar.gz" } ] }