Giter Club home page Giter Club logo

generateqrcode's Introduction

GenerateQRCode

Usage:

  • barcode-QRcode-generator_v4 [Path to csv file containing input data] [Path to output directory for PDF file]
  • A column titled 'ID' is used as the code content, otherwise the code content is automatically generate from the headers and values

Installation instructions

HINT: Use Terminal in PyCharm to run commands for installing packages using pip (not Python Console)

  • install python 3.7.2 64 bit edition
  • update pip: "python -m pip install --upgrade pip" from location of Python installation using Administrator privileged CMD shell.
  • pip install numpy
  • pip install opencv-contrib-python
  • run barcode-QRcodeScannerPy.py to install OpenCV (cv2)
  • pip install pyinstaller # Optional - only for making an exe
  • pip install ipywidgets # Optional, only for a jupyter notebook
  • jupyter nbextension enable --py widgetsnbextension # Optional, only for a jupyter notebook
  • pip install matplotlib
  • Install shapely
    • https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely
    • Then find corresponding wheel 'cp37' in wheel filename must match python version.
    • File --> Settings --> Project: --> Project Interpreter --> select existing project interpreter showing all packages installed (saves reinstalling them in a new virtual environment)

Using pyinstaller to generate an exe

https://medium.com/dreamcatcher-its-blog/making-an-stand-alone-executable-from-a-python-script-using-pyinstaller-d1df9170e263 pip install pyinstaller

20190326 Fixing bug in pyzbar when trying to use pyinstaller. NaturalHistoryMuseum/pyzbar#27 Specifically

  1. Generate the <project_name>.spec file by trying to run pyinstaller (it may fail or work, or the exe may give an error relating to not being able to find a module names libiconv.dll or libzbar-64.dll)
  2. Edit the .spec file generated by pyinstaller to include the following lines: from pathlib import Path from pyzbar import pyzbar ... # dylibs not detected because they are loaded by ctypes a.binaries += TOC([ (Path(dep._name).name, dep._name, 'BINARY') for dep in pyzbar.EXTERNAL_DEPENDENCIES ])
  3. Rerun pyinstaller with the .spec file as an argument (before the .py file)
  4. The .exe works! Otherwise put libiconv.dll in the same folder as the dll.

Notice if jpg is created, this might need additional lines in .spec as the github link above shows.

Progress

  • Generate QR codes in Python
  • Generate QR codes with human-readable labels in Python
  • Also removes strange characters
  • Add timestamp live (not in this committed module)
  • Generate PDF (not in this committed module) - PyFPDF good, but doesn't include bookmarks, https://www.blog.pythonlibrary.org/2018/06/05/creating-pdfs-with-pyfpdf-and-python/ - ReportLabs more complex: - http://www.devshed.com/c/a/python/python-for-pdf-generation/
  • Make code distributable (pyinstaller)
  • High speed update (real-time?) useful for timestamping image capture delays? (See v2 of QR-code-generator) (not in this committed module)
  • Given the list of generated QR codes and processed set of codes should have same filenames, can have a tool to compare them and identify duplicates and missing items.
  • Encode scale into the QR code, so its distance from the reader is known (assume printed correctly)
  • Web interface: http://webpy.org/, http://flask.pocoo.org/, https://blog.pythonanywhere.com/169/
  • Add website detailing the project and a fixed QR code which points to it, automatically generated on the cover of each document.
  • Add column containing bookmarks
  • Add column containing the actual code to embed (so can be user-defined), otherwise automatically generate it
  • Add GUI to select a file
  • Add GPS location live
  • Add orientation live
  • Q: How to make into a Python module?
  • Q: How to make into a Jupyter notebook? And import the module.
  • [Paused] Executable or wrap Python in R or wrap R in Python?
  • [Paused] rPython to run Python code from R
  • [Paused] Mlabwrap allows a bridge from Python to Matlab

Useful resources for QR codes and Python / Jupyter programming

generateqrcode's People

Contributors

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