{"library":"pyzxing","title":"PyZXing","description":"PyZXing is a Python wrapper for the popular ZXing Java library, providing functionality primarily for decoding 1D and 2D barcodes (like QR codes) from image files or in-memory image bytes. It currently stands at version 1.1.1 and has an irregular release cadence, largely driven by updates to the underlying ZXing Java core.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pyzxing"],"cli":null},"imports":["from pyzxing import BarCodeReader"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pyzxing import BarCodeReader\n\n# For demonstration, create a dummy image file if it doesn't exist\n# In a real scenario, 'barcode.png' would be an actual image with a barcode.\ndummy_image_path = 'barcode.png'\nif not os.path.exists(dummy_image_path):\n    print(f\"Warning: '{dummy_image_path}' not found. Decoding might fail. Please provide a real barcode image.\")\n    # Example of how you might create a dummy (non-barcode) file to prevent FileNotFoundError\n    with open(dummy_image_path, 'w') as f:\n        f.write('This is not an image.')\n\ntry:\n    reader = BarCodeReader()\n    # Decode from a file path\n    results = reader.decode(dummy_image_path)\n    if results:\n        for result in results:\n            print(f\"Decoded text: {result.get('parsed', 'N/A')}\")\n            print(f\"Format: {result.get('format', 'N/A')}\")\n    else:\n        print(f\"No barcode found in {dummy_image_path}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\nfinally:\n    # Clean up dummy file if created for demonstration\n    if not os.path.exists(dummy_image_path):\n        os.remove(dummy_image_path)","lang":"python","description":"Initializes the BarCodeReader and attempts to decode a barcode from a specified image file. Note that `pyzxing` calls an external Java process, requiring a JRE installation. Results are returned as a list of dictionaries.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"1.1.1","pypi_latest":"1.1.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4,"avg_import_s":0.78,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.62,"mem_mb":19.4,"disk_size":"91.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.7,"import_time_s":0.49,"mem_mb":19.4,"disk_size":"88M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.8,"mem_mb":21.1,"disk_size":"99.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.7,"import_time_s":0.71,"mem_mb":21.1,"disk_size":"95M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.02,"mem_mb":21.4,"disk_size":"96.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.1,"import_time_s":1,"mem_mb":21.4,"disk_size":"92M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.93,"mem_mb":22,"disk_size":"96.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.3,"import_time_s":0.94,"mem_mb":21.8,"disk_size":"92M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.62,"mem_mb":18.9,"disk_size":"99.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyzxing","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.4,"import_time_s":0.64,"mem_mb":18.9,"disk_size":"98M"}]}}