{
  "id": "task_libraries:qr-code/python",
  "path": "/exapedia/python-qr-code-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python QR code libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python QR code libraries encode text or a URL as a QR code and write it out as an image, a vector file, or terminal text. An encoder builds the grid of dark and light modules before a serializer draws it. These libraries let apps print payment links, tickets, and sign-in codes that a phone camera can scan."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python QR code libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#qrcode",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#segno",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F150"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyqrcode-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#treepoem",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F183"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#qrcodegen",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#qrcode",
          "label": [
            {
              "t": "text",
              "text": "qrcode"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F131"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "SVG serializer",
            "PNG serializer"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#qrcode",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F130"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#segno",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F150"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyqrcode-library",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F166"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#treepoem",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F183"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#qrcodegen",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "qrcode",
          "name": [
            {
              "t": "fact",
              "fact": "F130"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/lincolnloop/python-qrcode"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/qrcode"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/qrcode/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/qrcode/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jazzband/django-two-factor-auth",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def get(self, request, *args, **kwargs):\n    # Get the data from the session\n    try:\n        key = self.request.session[self.session_key_name]\n    except KeyError:\n        raise Http404()\n\n    # Get data for qrcode\n    image_factory_string = getattr(settings, 'TWO_FACTOR_QR_FACTORY', self.default_qr_factory)\n    image_factory = import_string(image_factory_string)\n    content_type = self.image_content_types[image_factory.kind]\n    username = self.get_username()\n\n    otpauth_url = get_otpauth_url(accountname=username,\n                                  issuer=self.get_issuer(),\n                                  secret=key,\n                                  digits=totp_digits())\n\n    # Make and return QR code\n    img = qrcode.make(otpauth_url, image_factory=image_factory)\n    resp = HttpResponse(content_type=content_type)\n    img.save(resp)\n    return resp",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jazzband/django-two-factor-auth/blob/a9c0b2e5d12f2848e646a8af4a251b2afc358e08/two_factor/views/core.py#L725-L747",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20qrcode%20for%20enrollment%20QR%20image%20responses%2C%20SVG%20normalization%20and%20configurable%20encoding&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/Edinburgh-Genome-Foundry/blabel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def qr_code(\n    data, optimize=20, fill_color=\"black\", back_color=\"white\", **qr_code_params\n):\n    \"\"\"Return a QR code's image data.\n\n    Powered by the Python library ``qrcode``. See this library's documentation\n    for more details.\n\n    Parameters\n    ----------\n    data\n      Data to be encoded in the QR code.\n\n    optimize\n      Chunk length optimization setting.\n\n    fill_color, back_color\n      Colors to use for QRcode and its background.\n\n    **qr_code_params\n      Parameters of the ``qrcode.QRCode`` constructor, such as ``version``,\n      ``error_correction``, ``box_size``, ``border``.\n\n    Returns\n    -------\n    image_base64_data\n      A string ``data:image/png;base64,xxxxxxxxx`` which you can provide as a\n      \"src\" parameter to a ``<img/>`` tag.\n\n    Examples\n    --------\n\n    >>> data = qr_code('egf45728')\n    >>> html_data = '<img src=\"%s\"/>' % data\n    \"\"\"\n    params = dict(box_size=5, border=0)\n    params.update(qr_code_params)\n    qr = qrcode.QRCode(**params)\n    qr.add_data(data, optimize=20)\n    qri = qr.make_image(fill_color=fill_color, back_color=back_color)\n    return pil_to_html_imgdata(qri.get_image())\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/Edinburgh-Genome-Foundry/blabel/blob/9accd2dc00aabb4199fedad788f71384e7340096/blabel/label_tools.py#L66-L106",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20qrcode%20for%20enrollment%20QR%20image%20responses%2C%20SVG%20normalization%20and%20configurable%20encoding&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F130"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import qrcode\nimage = qrcode.make('Hello, world!')\nimage.save('qr.png')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/qrcode/8.2/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F135"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "segno",
          "name": [
            {
              "t": "fact",
              "fact": "F150"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/heuer/segno"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/segno"
            },
            {
              "label": "Docs",
              "href": "https://segno.readthedocs.io/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F38"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F153"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://segno.readthedocs.io/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F150"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F46"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/dprog-philippe-docourt/django-qr-code",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F164"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@validate_call(config=PYDANTIC_CONFIG)\ndef make_qr(data: Any, qr_code_options: QRCodeOptions, force_text: bool = True):\n    \"\"\"Creates a QR code that encodes the given `data` with the given `qr_code_options`.\n\n    :param str data: The data to encode\n    :param qr_code_options: Options to create and serialize the QR code.\n    :param bool force_text: Tells whether we want to force the `data` to be considered as text string and encoded in byte mode.\n    :rtype: segno.QRCode\n    \"\"\"\n    # WARNING: For compatibility reasons, we still allow to pass __proxy__ class (lazy string). Moreover, it would be\n    # OK to pass anything that has __str__ attribute (e.g. class instance that handles phone numbers).\n    if force_text:\n        return segno.make(str(data), **qr_code_options.kw_make(), mode=\"byte\")\n    return segno.make(data, **qr_code_options.kw_make())",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/dprog-philippe-docourt/django-qr-code/blob/2803a185e56c8e286d77d24b4b7c46dfa1de2445/qr_code/qrcode/maker.py#L23-L36",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20segno%20for%20enrollment%20QR%20image%20responses%2C%20SVG%20normalization%20and%20configurable%20encoding&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F150"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import segno\nqr = segno.make_qr('Hello, world!')\nqr.save('qr.png', scale=5)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/segno/1.6.6/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F155"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyqrcode-library",
          "name": [
            {
              "t": "fact",
              "fact": "F166"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/mnooner256/pyqrcode"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyqrcode"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/pyqrcode/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/pyqrcode/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F166"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/home-assistant/core",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _generate_qr_code(data: str) -> str:\n    \"\"\"Generate a base64 PNG string represent QR Code image of data.\"\"\"\n    import pyqrcode  # noqa: PLC0415\n\n    qr_code = pyqrcode.create(data)\n\n    with BytesIO() as buffer:\n        qr_code.svg(file=buffer, scale=4)\n        return str(\n            buffer.getvalue()\n            .decode(\"ascii\")\n            .replace(\"\\n\", \"\")\n            .replace(\n                (\n                    '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n                    '<svg xmlns=\"http://www.w3.org/2000/svg\"'\n                ),\n                \"<svg\",\n            )\n        )",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/home-assistant/core/blob/aef7c996cbf2a46a37215ea768ab274f2a302506/homeassistant/auth/mfa_modules/totp.py#L39-L58",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F180"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyqrcode%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F166"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pyqrcode\nqr = pyqrcode.create('Hello, world!')\nqr.svg('qr.svg', scale=4)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pythonhosted.org/PyQRCode/moddoc.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "moddoc.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F171"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "treepoem",
          "name": [
            {
              "t": "fact",
              "fact": "F183"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/adamchainz/treepoem"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/treepoem"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/treepoem/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F89"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/treepoem/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F183"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F94"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F95"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F96"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F97"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import treepoem\nimage = treepoem.generate_barcode(barcode_type='qrcode', data='Hello, world!')\nimage.save('qr.png')\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/adamchainz/treepoem",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20treepoem%20for%20enrollment%20QR%20image%20responses%2C%20SVG%20normalization%20and%20configurable%20encoding&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F183"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F188"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "qrcodegen",
          "name": [
            {
              "t": "fact",
              "fact": "F195"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/nayuki/QR-Code-generator"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/qrcodegen"
            },
            {
              "label": "Docs",
              "href": "https://pypi.org/project/qrcodegen/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://pypi.org/project/qrcodegen/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F195"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/9001/copyparty",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F211"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _qrgen(data: Union[bytes, Sequence[int]]) -> \"QrCode\":\n    ret = None\n    V = QrCode.Ecc\n    for e in [V.HIGH, V.QUARTILE, V.MEDIUM, V.LOW]:\n        qr = QrCode.encode_binary(data, e)\n        qr.size = qr._size\n        qr.modules = qr._modules\n        if not ret or ret.size > qr.size:\n            ret = qr\n    return ret\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/9001/copyparty/blob/deb0380511737ad10b89c9ea929215d9330cf18f/copyparty/qrkode.py#L29-L38",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=qrcodegen%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F195"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from qrcodegen import QrCode\nqr = QrCode.encode_text('Hello, world!', QrCode.Ecc.MEDIUM)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://raw.githubusercontent.com/nayuki/QR-Code-generator/v1.8.0/python/qrcodegen.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "qrcodegen.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F200"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python QR code library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#qrcode",
          "label": [
            {
              "t": "text",
              "text": "qrcode"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits applications that style QR modules and embed images through image factories. "
        },
        {
          "t": "link",
          "href": "#segno",
          "label": [
            {
              "t": "text",
              "text": "Segno"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits code that needs Micro QR symbols or SVG, PNG, and PDF output without other dependencies. "
        },
        {
          "t": "link",
          "href": "#treepoem",
          "label": [
            {
              "t": "text",
              "text": "Treepoem"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits systems that render QR codes alongside other barcode formats."
        }
      ]
    },
    {
      "q": "What is Segno?",
      "a": [
        {
          "t": "link",
          "href": "#segno",
          "label": [
            {
              "t": "text",
              "text": "Segno"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a pure Python QR Code and Micro QR Code generator with no dependencies. It writes SVG, PNG, PDF, and other formats through its own serializers."
        }
      ]
    },
    {
      "q": "How do I generate a QR code in Python?",
      "a": [
        {
          "t": "link",
          "href": "#qrcode",
          "label": [
            {
              "t": "text",
              "text": "qrcode"
            }
          ]
        },
        {
          "t": "text",
          "text": " builds a code through its QRCode class and encodes it as an SVG or PNG image. "
        },
        {
          "t": "link",
          "href": "#segno",
          "label": [
            {
              "t": "text",
              "text": "Segno"
            }
          ]
        },
        {
          "t": "text",
          "text": " writes the same kind of code to SVG, PNG, or PDF without image dependencies."
        }
      ]
    },
    {
      "q": "Why does a styled QR code fail on some readers?",
      "a": [
        {
          "t": "link",
          "href": "#qrcode",
          "label": [
            {
              "t": "text",
              "text": "qrcode"
            }
          ]
        },
        {
          "t": "text",
          "text": " does not guarantee that styled codes work with all readers. Its documentation recommends testing them and setting error correction to high, especially when embedding an image."
        }
      ]
    },
    {
      "q": "Why did Segno produce a Micro QR symbol?",
      "a": [
        {
          "t": "text",
          "text": "Segno's default factory picks the smallest version that fits the content, including Micro QR versions. The make_qr function requires a standard QR code instead."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, qrcode",
      "display": "qrcode",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, qrcode",
      "display": "34.9M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, qrcode",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, qrcode",
      "display": "8.2, May 2025",
      "asOf": "2025-05-01"
    },
    "F5": {
      "label": "Package release date, qrcode",
      "display": "May 2025",
      "asOf": "2025-05-01"
    },
    "F6": {
      "label": "Repository stars, qrcode",
      "display": "5.0K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Error correction, qrcode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Styled QR codes, qrcode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Encoding modes, qrcode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Output formats, qrcode",
      "display": "SVG, PNG",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, qrcode",
      "display": "pip install qrcode",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, qrcode",
      "display": "Creates QR symbols with configurable image factories and styled module rendering.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, qrcode",
      "display": "Provides PNG and SVG factories",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, qrcode",
      "display": "Render raster images or scalable vectors from the same QR generation API.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, qrcode",
      "display": "Supports styled QR modules",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, qrcode",
      "display": "Customize module shapes, colors, and embedded images through image factories.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, qrcode",
      "display": "Styled codes need reader testing",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, qrcode",
      "display": "Check styled output with target readers before using it in a product.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, qrcode",
      "display": "Appending data preserves previous content",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, qrcode",
      "display": "Clear the QR object before replacing its payload.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, qrcode",
      "display": "import qrcode\nimport qrcode.image.svg\n\nmethod = input(\"What method? (basic, fragment, path): \")\n\nif method == 'basic':\n    # Simple factory, just a set of rects.\n    factory = qrcode.image.svg.SvgImage\nelif method == 'fragment':\n    # Fragment factory (no standalone header)\n    factory = qrcode.image.svg.SvgFragmentImage\nelse:\n    # Combined path factory, fixes white space that may occur when zooming\n    factory = qrcode.image.svg.SvgPathImage\n\nimg = qrcode.make('Some data here', image_factory=factory)\n\nimg.save('some_file.svg')\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, qrcode",
      "display": "def get(self, request, *args, **kwargs):\n    # Get the data from the session\n    try:\n        key = self.request.session[self.session_key_name]\n    except KeyError:\n        raise Http404()\n\n    # Get data for qrcode\n    image_factory_string = getattr(settings, 'TWO_FACTOR_QR_FACTORY', self.default_qr_factory)\n    image_factory = import_string(image_factory_string)\n    content_type = self.image_content_types[image_factory.kind]\n    username = self.get_username()\n\n    otpauth_url = get_otpauth_url(accountname=username,\n                                  issuer=self.get_issuer(),\n                                  secret=key,\n                                  digits=totp_digits())\n\n    # Make and return QR code\n    img = qrcode.make(otpauth_url, image_factory=image_factory)\n    resp = HttpResponse(content_type=content_type)\n    img.save(resp)\n    return resp\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, qrcode",
      "display": "core.py · get()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, qrcode",
      "display": "jazzband/django-two-factor-auth",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, jazzband/django-two-factor-auth",
      "display": "1.9K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, jazzband/django-two-factor-auth",
      "display": "Nov 2026",
      "asOf": "2026-11-11"
    },
    "F27": {
      "label": "Library name, segno",
      "display": "Segno",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, segno",
      "display": "11.4M",
      "asOf": "2026-11-16"
    },
    "F29": {
      "label": "License, segno",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, segno",
      "display": "1.6.6, Mar 2025",
      "asOf": "2025-03-12"
    },
    "F31": {
      "label": "Package release date, segno",
      "display": "Mar 2025",
      "asOf": "2025-03-12"
    },
    "F32": {
      "label": "Repository stars, segno",
      "display": "823",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Error correction, segno",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Styled QR codes, segno",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Encoding modes, segno",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Output formats, segno",
      "display": "SVG, PNG, PDF",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Install, segno",
      "display": "pip install segno",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "What it does, segno",
      "display": "Creates QR and Micro QR symbols with dependency-free vector and raster serializers.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, segno",
      "display": "Generates Micro QR symbols",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, segno",
      "display": "Create compact symbols or explicitly require standard QR output.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, segno",
      "display": "Exports without image dependencies",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, segno",
      "display": "Write SVG, PNG, and PDF using the included serializers.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, segno",
      "display": "Small payloads can become Micro",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, segno",
      "display": "Use make_qr or micro=False when the receiving system requires standard QR.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations lead, segno",
      "display": "Error correction can increase automatically",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations, segno",
      "display": "Disable boost_error when the selected error correction level must remain unchanged.",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Quickstart, segno",
      "display": "import segno\nqrcode = segno.make('Yellow Submarine')\nqrcode.save('yellow-submarine.png')\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function, segno",
      "display": "@validate_call(config=PYDANTIC_CONFIG)\ndef make_qr(data: Any, qr_code_options: QRCodeOptions, force_text: bool = True):\n    # ...\n    # WARNING: For compatibility reasons, we still allow to pass __proxy__ class (lazy string). Moreover, it would be\n    # OK to pass anything that has __str__ attribute (e.g. class instance that handles phone numbers).\n    if force_text:\n        return segno.make(str(data), **qr_code_options.kw_make(), mode=\"byte\")\n    return segno.make(data, **qr_code_options.kw_make())\n",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project function reference, segno",
      "display": "maker.py · make_qr()",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project repository, segno",
      "display": "dprog-philippe-docourt/django-qr-code",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project stars, dprog-philippe-docourt/django-qr-code",
      "display": "175",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Project push date, dprog-philippe-docourt/django-qr-code",
      "display": "Nov 2026",
      "asOf": "2026-11-01"
    },
    "F53": {
      "label": "Library name, PyQRCode",
      "display": "PyQRCode",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Monthly downloads, PyQRCode",
      "display": "1.5M",
      "asOf": "2026-11-16"
    },
    "F55": {
      "label": "License, PyQRCode",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Package release, PyQRCode",
      "display": "1.2.1, Jun 2016",
      "asOf": "2016-06-20"
    },
    "F57": {
      "label": "Package release date, PyQRCode",
      "display": "Jun 2016",
      "asOf": "2016-06-20"
    },
    "F58": {
      "label": "Repository stars, PyQRCode",
      "display": "428",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Error correction, PyQRCode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Styled QR codes, PyQRCode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Encoding modes, PyQRCode",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Output formats, PyQRCode",
      "display": "SVG, PNG, Text",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "Install, PyQRCode",
      "display": "pip install pyqrcode",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "What it does, PyQRCode",
      "display": "Generates Python QR symbols with selectable encoding and image or text renderers.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths lead, PyQRCode",
      "display": "Renders SVG without image dependencies",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths, PyQRCode",
      "display": "Generate scalable SVG without installing a separate image renderer.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths lead, PyQRCode",
      "display": "Exposes encoding controls",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "strengths, PyQRCode",
      "display": "Choose numeric, alphanumeric, kanji, or binary encoding when automatic selection is unsuitable.",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations lead, PyQRCode",
      "display": "PNG needs an extra dependency",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations, PyQRCode",
      "display": "Install pypng when the application needs PNG output.",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations lead, PyQRCode",
      "display": "ECI encoding is unimplemented",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "limitations, PyQRCode",
      "display": "Choose another encoder when a symbol needs multiple character encodings.",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Quickstart, PyQRCode",
      "display": "import pyqrcode\nqr = pyqrcode.create('Unladden swallow')\nqr.png('famous-joke.png', scale=5)\n",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project function, PyQRCode",
      "display": "def _generate_qr_code(data: str) -> str:\n    # ...\n    import pyqrcode  # noqa: PLC0415\n\n    qr_code = pyqrcode.create(data)\n\n    with BytesIO() as buffer:\n        qr_code.svg(file=buffer, scale=4)\n        return str(\n            buffer.getvalue()\n            .decode(\"ascii\")\n            .replace(\"\\n\", \"\")\n            .replace(\n                (\n                    '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n                    '<svg xmlns=\"http://www.w3.org/2000/svg\"'\n                ),\n                \"<svg\",\n            )\n        )\n",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project function reference, PyQRCode",
      "display": "totp.py · _generate_qr_code()",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project repository, PyQRCode",
      "display": "home-assistant/core",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project stars, home-assistant/core",
      "display": "92.3K",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Project push date, home-assistant/core",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F79": {
      "label": "Library name, treepoem",
      "display": "Treepoem",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Monthly downloads, treepoem",
      "display": "45.1K",
      "asOf": "2026-11-16"
    },
    "F81": {
      "label": "License, treepoem",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Package release, treepoem",
      "display": "3.29.0, Sep 2026",
      "asOf": "2026-09-29"
    },
    "F83": {
      "label": "Package release date, treepoem",
      "display": "Sep 2026",
      "asOf": "2026-09-29"
    },
    "F84": {
      "label": "Repository stars, treepoem",
      "display": "165",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Error correction, treepoem",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Encoding modes, treepoem",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Output formats, treepoem",
      "display": "PNG",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Install, treepoem",
      "display": "pip install treepoem",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "What it does, treepoem",
      "display": "Renders QR and other barcodes through BWIPP and Ghostscript, returning Pillow images.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, treepoem",
      "display": "Handles several barcode symbologies",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, treepoem",
      "display": "Use the same renderer for QR, Aztec, and linear barcode formats.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths lead, treepoem",
      "display": "Returns images for further composition",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "strengths, treepoem",
      "display": "Add borders or combine the generated Pillow image with other graphics.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations lead, treepoem",
      "display": "Requires external Ghostscript",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations, treepoem",
      "display": "Install the Ghostscript executable alongside the Python package.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations lead, treepoem",
      "display": "Options follow the barcode engine",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "limitations, treepoem",
      "display": "Pass barcode-specific BWIPP options rather than the other libraries’ QR keyword arguments.",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Quickstart, treepoem",
      "display": "import treepoem\nfrom PIL import ImageOps\n\nimage = treepoem.generate_barcode(\n    barcode_type=\"qrcode\",\n    data=\"https://example.com\",\n)\nimage = ImageOps.expand(image, border=10, fill=\"white\")\nimage.convert(\"1\").save(\"barcode.png\")\n",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Developer need",
      "display": "Styling QR modules and images",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Why choose qrcode",
      "display": "custom module drawers and image factories",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need in introduction",
      "display": "styling QR modules and images",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "When to consider segno",
      "display": "Micro QR output is required",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need",
      "display": "Generating compact Micro QR symbols",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Why choose segno",
      "display": "explicit standard and Micro QR factories",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need in introduction",
      "display": "generating compact Micro QR symbols",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "When to consider qrcode",
      "display": "styled image-factory rendering is the main requirement",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need",
      "display": "Creating SVG without an image renderer",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Why choose PyQRCode",
      "display": "a self-contained SVG renderer",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need in introduction",
      "display": "creating SVG without an image renderer",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "When to consider segno",
      "display": "PNG and PDF should also avoid image dependencies",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need",
      "display": "Rendering multiple barcode symbologies",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Why choose treepoem",
      "display": "one wrapper around the BWIPP barcode engine",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need in introduction",
      "display": "rendering multiple barcode symbologies",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "When to consider segno",
      "display": "QR output should avoid an external rendering executable",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "Page introduction",
      "display": "Python QR code libraries let application developers generate or read QR codes.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Which Python QR code generator should I use?",
      "display": "qrcode provides configurable and styled image factories.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Which Python QR code generator should I use?",
      "display": "Segno generates standard QR and Micro QR symbols.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Which Python QR code generator should I use?",
      "display": "PyQRCode includes an SVG renderer without external image modules.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Which Python QR code generator should I use?",
      "display": "Treepoem wraps a multi-symbology barcode engine and Ghostscript.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Which library creates PNG and SVG without Pillow?",
      "display": "qrcode can encode PNG through its pure-Python factory and also supports SVG.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Which library creates PNG and SVG without Pillow?",
      "display": "Segno includes dependency-free serializers for SVG, PNG, and PDF.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Which library creates PNG and SVG without Pillow?",
      "display": "PyQRCode writes SVG directly and requires pypng for PNG.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Why did Segno produce a Micro QR symbol?",
      "display": "Its default factory chooses the smallest suitable standard or Micro QR version.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Why did Segno produce a Micro QR symbol?",
      "display": "Use make_qr or set micro=False to require standard QR output.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Why does a styled QR code fail on some readers?",
      "display": "qrcode explicitly warns that styled output is not guaranteed to work with all readers; test target readers.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: How do I replace data when reusing a qrcode object?",
      "display": "add_data appends to existing content; call clear before adding a replacement payload.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does stronger error correction reduce capacity?",
      "display": "PyQRCode describes its highest error correction setting as having the smallest available data capacity.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Can a long message be split across QR symbols?",
      "display": "Segno supports structured append to split one message across several QR symbols; this is unavailable for Micro QR.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Why does Treepoem need another executable?",
      "display": "Treepoem wraps the BWIPP renderer and Ghostscript; install Ghostscript in addition to the Python package.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "Library name, qrcode",
      "display": "qrcode",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Monthly downloads, qrcode",
      "display": "36.3M",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "License, qrcode",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release, qrcode",
      "display": "8.2",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release date, qrcode",
      "display": "May 2025",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Install, qrcode",
      "display": "pip install \"qrcode[pil]\"",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Quickstart, qrcode",
      "display": "import qrcode\nimage = qrcode.make('Hello, world!')\nimage.save('qr.png')\n",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Repository stars, qrcode",
      "display": "5.0K",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "SVG serializer, qrcode",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "PNG serializer, qrcode",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Rendering backends, qrcode",
      "display": "SVG factories, optional Pillow/PyPNG, and terminal output",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Bitmap dependency mismatch, qrcode",
      "display": "README standard-install claim differs from8.2 optional-extra metadata",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project function, qrcode",
      "display": "def get(self, request, *args, **kwargs):\n    # Get the data from the session\n    try:\n        key = self.request.session[self.session_key_name]\n    except KeyError:\n        raise Http404()\n\n    # Get data for qrcode\n    image_factory_string = getattr(settings, 'TWO_FACTOR_QR_FACTORY', self.default_qr_factory)\n    image_factory = import_string(image_factory_string)\n    content_type = self.image_content_types[image_factory.kind]\n    username = self.get_username()\n\n    otpauth_url = get_otpauth_url(accountname=username,\n                                  issuer=self.get_issuer(),\n                                  secret=key,\n                                  digits=totp_digits())\n\n    # Make and return QR code\n    img = qrcode.make(otpauth_url, image_factory=image_factory)\n    resp = HttpResponse(content_type=content_type)\n    img.save(resp)\n    return resp",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project source file, qrcode",
      "display": "two_factor/views/core.py",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project full_name, qrcode",
      "display": "jazzband/django-two-factor-auth",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project stargazers_count, qrcode",
      "display": "1.9K",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project function, qrcode",
      "display": "def qr_code(\n    data, optimize=20, fill_color=\"black\", back_color=\"white\", **qr_code_params\n):\n    \"\"\"Return a QR code's image data.\n\n    Powered by the Python library ``qrcode``. See this library's documentation\n    for more details.\n\n    Parameters\n    ----------\n    data\n      Data to be encoded in the QR code.\n\n    optimize\n      Chunk length optimization setting.\n\n    fill_color, back_color\n      Colors to use for QRcode and its background.\n\n    **qr_code_params\n      Parameters of the ``qrcode.QRCode`` constructor, such as ``version``,\n      ``error_correction``, ``box_size``, ``border``.\n\n    Returns\n    -------\n    image_base64_data\n      A string ``data:image/png;base64,xxxxxxxxx`` which you can provide as a\n      \"src\" parameter to a ``<img/>`` tag.\n\n    Examples\n    --------\n\n    >>> data = qr_code('egf45728')\n    >>> html_data = '<img src=\"%s\"/>' % data\n    \"\"\"\n    params = dict(box_size=5, border=0)\n    params.update(qr_code_params)\n    qr = qrcode.QRCode(**params)\n    qr.add_data(data, optimize=20)\n    qri = qr.make_image(fill_color=fill_color, back_color=back_color)\n    return pil_to_html_imgdata(qri.get_image())\n",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Project source file, qrcode",
      "display": "blabel/label_tools.py",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Project full_name, qrcode",
      "display": "Edinburgh-Genome-Foundry/blabel",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Project stargazers_count, qrcode",
      "display": "207",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Library name, segno",
      "display": "Segno",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Monthly downloads, segno",
      "display": "12.0M",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "License, segno",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Package release, segno",
      "display": "1.6.6",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Package release date, segno",
      "display": "Mar 2025",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Install, segno",
      "display": "pip install segno",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Quickstart, segno",
      "display": "import segno\nqr = segno.make_qr('Hello, world!')\nqr.save('qr.png', scale=5)\n",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Repository stars, segno",
      "display": "823",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "SVG serializer, segno",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "PNG serializer, segno",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Compact symbols, segno",
      "display": "Native Micro QR and standard QR",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Structured append, segno",
      "display": "Splits message across several QR codes",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project function, segno",
      "display": "@validate_call(config=PYDANTIC_CONFIG)\ndef make_qr(data: Any, qr_code_options: QRCodeOptions, force_text: bool = True):\n    \"\"\"Creates a QR code that encodes the given `data` with the given `qr_code_options`.\n\n    :param str data: The data to encode\n    :param qr_code_options: Options to create and serialize the QR code.\n    :param bool force_text: Tells whether we want to force the `data` to be considered as text string and encoded in byte mode.\n    :rtype: segno.QRCode\n    \"\"\"\n    # WARNING: For compatibility reasons, we still allow to pass __proxy__ class (lazy string). Moreover, it would be\n    # OK to pass anything that has __str__ attribute (e.g. class instance that handles phone numbers).\n    if force_text:\n        return segno.make(str(data), **qr_code_options.kw_make(), mode=\"byte\")\n    return segno.make(data, **qr_code_options.kw_make())",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project source file, segno",
      "display": "qr_code/qrcode/maker.py",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project full_name, segno",
      "display": "dprog-philippe-docourt/django-qr-code",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Project stargazers_count, segno",
      "display": "175",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Library name, pyqrcode",
      "display": "PyQRCode",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Monthly downloads, pyqrcode",
      "display": "1.6M",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "License, pyqrcode",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Package release, pyqrcode",
      "display": "1.2.1",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Package release date, pyqrcode",
      "display": "Jun 2016",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Install, pyqrcode",
      "display": "pip install pyqrcode",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Quickstart, pyqrcode",
      "display": "import pyqrcode\nqr = pyqrcode.create('Hello, world!')\nqr.svg('qr.svg', scale=4)\n",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Official description, pyqrcode",
      "display": "Generates QR codes in pure Python with SVG, EPS, PNG, and terminal output.",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Quickstart source file, pyqrcode",
      "display": "moddoc (API recipe)",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Repository stars, pyqrcode",
      "display": "428",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "SVG serializer, pyqrcode",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "PNG serializer, pyqrcode",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Encoder and output, pyqrcode",
      "display": "Pure Python encoding with native SVG and optional PyPNG",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project function, pyqrcode",
      "display": "def _generate_qr_code(data: str) -> str:\n    \"\"\"Generate a base64 PNG string represent QR Code image of data.\"\"\"\n    import pyqrcode  # noqa: PLC0415\n\n    qr_code = pyqrcode.create(data)\n\n    with BytesIO() as buffer:\n        qr_code.svg(file=buffer, scale=4)\n        return str(\n            buffer.getvalue()\n            .decode(\"ascii\")\n            .replace(\"\\n\", \"\")\n            .replace(\n                (\n                    '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n                    '<svg xmlns=\"http://www.w3.org/2000/svg\"'\n                ),\n                \"<svg\",\n            )\n        )",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project source file, pyqrcode",
      "display": "homeassistant/auth/mfa_modules/totp.py",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project full_name, pyqrcode",
      "display": "home-assistant/core",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Project stargazers_count, pyqrcode",
      "display": "92.3K",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Library name, treepoem",
      "display": "Treepoem",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Monthly downloads, treepoem",
      "display": "48.6K",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "License, treepoem",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Package release, treepoem",
      "display": "3.29.0",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Package release date, treepoem",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Install, treepoem",
      "display": "pip install treepoem",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Quickstart, treepoem",
      "display": "import treepoem\nimage = treepoem.generate_barcode(barcode_type='qrcode', data='Hello, world!')\nimage.save('qr.png')\n",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Repository stars, treepoem",
      "display": "165",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "SVG serializer, treepoem",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "PNG serializer, treepoem",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Runtime, treepoem",
      "display": "Requires external Ghostscript, wrapping BWIPP",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Symbology breadth, treepoem",
      "display": "QR alongside Aztec, PDF417, and linear barcodes",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Library name, qrcodegen",
      "display": "qrcodegen",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Monthly downloads, qrcodegen",
      "display": "27.4K",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "License, qrcodegen",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Package release, qrcodegen",
      "display": "1.8.0",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Package release date, qrcodegen",
      "display": "Apr 2022",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Install, qrcodegen",
      "display": "pip install qrcodegen",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Quickstart, qrcodegen",
      "display": "from qrcodegen import QrCode\nqr = QrCode.encode_text('Hello, world!', QrCode.Ecc.MEDIUM)\n",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Official description, qrcodegen",
      "display": "Generates QR Code symbols in Python.",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Quickstart source file, qrcodegen",
      "display": "python/qrcodegen.py (API recipe)",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Repository stars, qrcodegen",
      "display": "6.8K",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "SVG serializer, qrcodegen",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "PNG serializer, qrcodegen",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Output boundary, qrcodegen",
      "display": "Raw module matrix; host supplies visual rendering",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Encoding controls, qrcodegen",
      "display": "All40 standard QR Model2 versions and four error-correction levels",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Project function, qrcodegen",
      "display": "def _qrgen(data: Union[bytes, Sequence[int]]) -> \"QrCode\":\n    ret = None\n    V = QrCode.Ecc\n    for e in [V.HIGH, V.QUARTILE, V.MEDIUM, V.LOW]:\n        qr = QrCode.encode_binary(data, e)\n        qr.size = qr._size\n        qr.modules = qr._modules\n        if not ret or ret.size > qr.size:\n            ret = qr\n    return ret\n",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Project source file, qrcodegen",
      "display": "copyparty/qrkode.py",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project full_name, qrcodegen",
      "display": "9001/copyparty",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project stargazers_count, qrcodegen",
      "display": "47.4K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python QR code generator libraries qrcode Segno PyQRCode Treepoem SVG PNG code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
