{
  "id": "task_libraries:compression/python",
  "path": "/exapedia/python-compression-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python compression libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python compression libraries shrink data for storage or transfer and restore it byte for byte. Each codec trades compression ratio against speed, from fast codecs for streaming to slow codecs that maximize savings. These libraries let data pipelines, web servers, and file formats cut storage and bandwidth costs."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python compression libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#python-zstandard",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#brotli",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-lz",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#backports-zstd",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#zopfli",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F202"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cramjam",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#inflatesixfour",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyppmd",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F255"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            ]
          ],
          "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": "#python-zstandard",
          "label": [
            {
              "t": "fact",
              "fact": "F1"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F2"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Multiple codec families",
            "Incremental codec context"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#python-zstandard",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F128"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#brotli",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#python-lz",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#backports-zstd",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F182"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#zopfli",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F202"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cramjam",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F221"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#inflatesixfour",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F236"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F246"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pyppmd",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F255"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "python-zstandard",
          "name": [
            {
              "t": "fact",
              "fact": "F128"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/indygreg/python-zstandard"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/zstandard"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F129"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/indygreg/python-zstandard",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F128"
                    },
                    {
                      "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/dpkp/kafka-python",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def zstd_decode(payload):\n    if not zstd:\n        raise NotImplementedError(\"Zstd codec is not available\")\n    with zstd.ZstdDecompressor().stream_reader(io.BytesIO(payload), read_across_frames=True) as reader:\n        return reader.read()\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/dpkp/kafka-python/blob/89df9871b84843ad8b9dbd48d5b8d11d06227acf/kafka/codec.py#L321-L325",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20zstandard%20for%20framed%20compression%2C%20Kafka%20payloads%20and%20bounded%20stream%20processing&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": "F128"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import zstandard as zstd\n\ncompressed = zstd.compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://python-zstandard.readthedocs.io/en/latest/one_shot_api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "compressor.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "brotli",
          "name": [
            {
              "t": "fact",
              "fact": "F146"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/google/brotli"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/brotli"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F153"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/google/brotli",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/encode/httpx",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def decode(self, data: bytes) -> bytes:\n        if not data:\n            return b\"\"\n        self.seen_data = True\n        try:\n            return self._decompress(data)\n        except brotli.error as exc:\n            raise DecodingError(str(exc)) from exc\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/encode/httpx/blob/7cff5f79bc78649bbcd3fd9aa7a74c86e0f63016/httpx/_decoders.py#L136-L143",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=brotli%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import brotli\n\ncompressed = brotli.compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/google/brotli/blob/master/python/brotli.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "brotli.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F151"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "python-lz",
          "name": [
            {
              "t": "fact",
              "fact": "F165"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/python-lz4/python-lz4"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/lz4"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F38"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/python-lz4/python-lz4",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F165"
                    },
                    {
                      "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": "F180"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/joblib/joblib",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F180"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def compressor_file(self, fileobj, compresslevel=None):\n        \"\"\"Returns an instance of a compressor file object.\"\"\"\n        self._check_versions()\n        if compresslevel is None:\n            return self.fileobj_factory(fileobj, \"wb\")\n        else:\n            return self.fileobj_factory(fileobj, \"wb\", compression_level=compresslevel)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/joblib/joblib/blob/6a12020870c37029e605aa10739a4502445e390f/joblib/compressor.py#L209-L215",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20lz4%20for%20framed%20compression%2C%20Kafka%20payloads%20and%20bounded%20stream%20processing&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": "F165"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import lz4.frame\n\ncompressed = lz4.frame.compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://python-lz4.readthedocs.io/en/stable/lz4.frame.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "backports-zstd",
          "name": [
            {
              "t": "fact",
              "fact": "F182"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Rogdham/backports.zstd"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/backports.zstd"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F189"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/Rogdham/backports.zstd",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F182"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/urllib3/urllib3",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def decompress(self, data: bytes, max_length: int = -1) -> bytes:\n            if not data and not self.has_unconsumed_tail:\n                return b\"\"\n            if self._obj.eof:\n                data = self._obj.unused_data + data\n                self._obj = zstd.ZstdDecompressor()\n            part = self._obj.decompress(data, max_length=max_length)\n            length = len(part)\n            data_parts = [part]\n            # Every loop iteration is supposed to read data from a separate frame.\n            # The loop breaks when:\n            #   - enough data is read;\n            #   - no more unused data is available;\n            #   - end of the last read frame has not been reached (i.e.,\n            #     more data has to be fed).\n            while (\n                self._obj.eof\n                and self._obj.unused_data\n                and (max_length < 0 or length < max_length)\n            ):\n                unused_data = self._obj.unused_data\n                if not self._obj.needs_input:\n                    self._obj = zstd.ZstdDecompressor()\n                part = self._obj.decompress(\n                    unused_data,\n                    max_length=(max_length - length) if max_length > 0 else -1,\n                )\n                if part_length := len(part):\n                    data_parts.append(part)\n                    length += part_length\n                elif self._obj.needs_input:\n                    break\n            return b\"\".join(data_parts)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/urllib3/urllib3/blob/d9f9b0ad5b99247e06aa9a50b7a5747aa5c2e35d/src/urllib3/response.py#L286-L318",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=backports.zstd%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F182"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import sys\n\nif sys.version_info >= (3, 14):\n    from compression import zstd\nelse:\n    from backports import zstd\n\ncompressed = zstd.compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/backports.zstd/1.8.0/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F187"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "zopfli",
          "name": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/fonttools/py-zopfli"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/zopfli"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F209"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/fonttools/py-zopfli",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F202"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fonttools/fonttools",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F219"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def compress(data, level=ZLIB_COMPRESSION_LEVEL):\n    \"\"\"Compress 'data' to Zlib format. If 'USE_ZOPFLI' variable is True,\n    zopfli is used instead of the zlib module.\n    The compression 'level' must be between 0 and 9. 1 gives best speed,\n    9 gives best compression (0 gives no compression at all).\n    The default value is a compromise between speed and compression (6).\n    \"\"\"\n    if not (0 <= level <= 9):\n        raise ValueError(\"Bad compression level: %s\" % level)\n    if not USE_ZOPFLI or level == 0:\n        from zlib import compress\n\n        return compress(data, level)\n    else:\n        from zopfli.zlib import compress\n\n        return compress(data, numiterations=ZOPFLI_LEVELS[level])\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fonttools/fonttools/blob/f3f799e1b6c090096d7dc9a6ca22f26dd25a4c81/Lib/fontTools/ttLib/sfnt.py#L186-L202",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F218"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=zopfli%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F202"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from zopfli.zlib import compress\n\ncompressed = compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/zopfli/0.4.3/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F207"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "cramjam",
          "name": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/milesgranger/cramjam"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/cramjam"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/milesgranger/cramjam",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F221"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import cramjam\n\ncompressed = bytes(cramjam.snappy.compress(b\"hello\"))\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/milesgranger/cramjam/blob/v2.14.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20cramjam%20for%20framed%20compression%2C%20Kafka%20payloads%20and%20bounded%20stream%20processing&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": "F221"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F226"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "inflatesixfour",
          "name": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/miurahr/inflate64"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/inflate64"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F243"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/inflate64",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/py7zr",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F253"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def decompress(self, data: bytes | bytearray | memoryview, max_length: int = -1) -> bytes:\n        if not self._enabled:\n            raise UnsupportedCompressionMethodError(None, \"deflate64 is disabled on pypy.\")\n        if len(data) == 0:\n            if self.flushed:\n                return b\"\"\n            else:\n                self.flushed = True\n                return self._decompressor.inflate(b\"\")\n        return self._decompressor.inflate(data)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/py7zr/blob/eab11e95bd12dfb56ec31200c8b2992a3e1acc12/py7zr/compressor.py#L308-L317",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F252"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=inflate64%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F236"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import inflate64\n\ncompressor = inflate64.Deflater()\ncompressed = compressor.deflate(b\"hello\") + compressor.flush()\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/inflate64/1.0.4/json#info.description",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.rst"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F241"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pyppmd",
          "name": [
            {
              "t": "fact",
              "fact": "F255"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/miurahr/pyppmd"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pyppmd"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F262"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F264"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/pyppmd",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F255"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F272"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F273"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/py7zr",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F272"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def decompress(self, data: bytes | bytearray | memoryview, max_length=-1) -> bytes:\n        if len(data) == 0 and self.decoder.needs_input:\n            return self.decoder.decode(b\"\\0\", max_length)\n        return self.decoder.decode(data, max_length)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/py7zr/blob/eab11e95bd12dfb56ec31200c8b2992a3e1acc12/py7zr/compressor.py#L347-L350",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F271"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pyppmd%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F255"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import pyppmd\n\ncompressed = pyppmd.compress(b\"hello\")\nprint(compressed)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/miurahr/pyppmd/blob/v1.3.1/src/pyppmd/__init__.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "__init__.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F260"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python compression library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#python-zstandard",
          "label": [
            {
              "t": "text",
              "text": "zstandard"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits general compression with a strong ratio at high speed. "
        },
        {
          "t": "link",
          "href": "#python-lz",
          "label": [
            {
              "t": "fact",
              "fact": "F165"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits workloads that need the fastest compression and decompression. "
        },
        {
          "t": "link",
          "href": "#brotli",
          "label": [
            {
              "t": "text",
              "text": "Brotli"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits web assets served to browsers."
        }
      ]
    },
    {
      "q": "Brotli vs gzip: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "Brotli usually compresses text smaller than gzip at a similar decompression speed. Browsers accept both encodings for HTTP responses."
        }
      ]
    },
    {
      "q": "Zstd vs gzip: which should I use?",
      "a": [
        {
          "t": "text",
          "text": "Zstandard compresses faster than gzip at a similar or higher ratio and decompresses much faster. gzip remains the choice where only the standard library or older tools are available."
        }
      ]
    },
    {
      "q": "Does Python include compression modules?",
      "a": [
        {
          "t": "text",
          "text": "The standard library includes zlib, gzip, and lzma modules. Recent releases add a Zstandard module, and "
        },
        {
          "t": "link",
          "href": "#backports-zstd",
          "label": [
            {
              "t": "text",
              "text": "backports.zstd"
            }
          ]
        },
        {
          "t": "text",
          "text": " brings that module to older versions."
        }
      ]
    },
    {
      "q": "What is cramjam?",
      "a": [
        {
          "t": "link",
          "href": "#cramjam",
          "label": [
            {
              "t": "text",
              "text": "cramjam"
            }
          ]
        },
        {
          "t": "text",
          "text": " bundles many compression algorithms, including Snappy, Brotli, and Zstandard, behind one set of Rust-backed bindings."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, zstandard",
      "display": "python-zstandard",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, zstandard",
      "display": "188.2M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, zstandard",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, zstandard",
      "display": "0.25.0, Sep 2025",
      "asOf": "2025-09-14"
    },
    "F5": {
      "label": "Package release date, zstandard",
      "display": "Sep 2025",
      "asOf": "2025-09-14"
    },
    "F6": {
      "label": "Repository stars, zstandard",
      "display": "649",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Incremental compression, zstandard",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Incremental decompression, zstandard",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "File-like objects, zstandard",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Compression levels, zstandard",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, zstandard",
      "display": "pip install zstandard",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, zstandard",
      "display": "Exposes Zstandard compression through one-shot and streaming Python APIs.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, zstandard",
      "display": "Reuses compression contexts",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, zstandard",
      "display": "Reuse a compressor for repeated operations instead of recreating it.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, zstandard",
      "display": "Supports shared compression dictionaries",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, zstandard",
      "display": "Improve compression for small inputs that share recurring structure.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, zstandard",
      "display": "Concurrent operations need separate contexts",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, zstandard",
      "display": "Create a separate context for each simultaneously active operation.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, zstandard",
      "display": "One-shot operations hold both buffers",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, zstandard",
      "display": "Use streaming when input and output cannot fit in memory together.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, zstandard",
      "display": "import zstandard\n\ncctx = zstandard.ZstdCompressor()\ncompressed = cctx.compress(b\"data to compress\")\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, zstandard",
      "display": "def zstd_decode(payload):\n    if not zstd:\n        raise NotImplementedError(\"Zstd codec is not available\")\n    with zstd.ZstdDecompressor().stream_reader(io.BytesIO(payload), read_across_frames=True) as reader:\n        return reader.read()\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, zstandard",
      "display": "codec.py · zstd_decode()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, zstandard",
      "display": "dpkp/kafka-python",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, dpkp/kafka-python",
      "display": "5.9K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, dpkp/kafka-python",
      "display": "Nov 2026",
      "asOf": "2026-11-11"
    },
    "F27": {
      "label": "Library name, lz4",
      "display": "python-lz4",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, lz4",
      "display": "84.9M",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "License, lz4",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, lz4",
      "display": "4.4.5, Nov 2025",
      "asOf": "2025-11-03"
    },
    "F31": {
      "label": "Package release date, lz4",
      "display": "Nov 2025",
      "asOf": "2025-11-03"
    },
    "F32": {
      "label": "Repository stars, lz4",
      "display": "306",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Incremental compression, lz4",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Incremental decompression, lz4",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "File-like objects, lz4",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Compression levels, lz4",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Install, lz4",
      "display": "pip install lz4",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "What it does, lz4",
      "display": "Provides Python bindings for interoperable LZ4 frame compression.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, lz4",
      "display": "Produces interoperable LZ4 frames",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, lz4",
      "display": "Use frame bindings when exchanging compressed data with other implementations.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, lz4",
      "display": "Processes data in chunks",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, lz4",
      "display": "Compress and decompress incrementally instead of holding the full input.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, lz4",
      "display": "Checksums are disabled by default",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, lz4",
      "display": "Enable content_checksum when frame content needs checksum validation.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations lead, lz4",
      "display": "Buffered chunks can delay output",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations, lz4",
      "display": "Enable auto_flush when each compression call needs immediate output.",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Quickstart, lz4",
      "display": "import lz4.frame\nimport os\ninput_data = 20 * 128 * os.urandom(1024)\nwith lz4.frame.LZ4FrameCompressor() as compressor:\n    compressed = compressor.begin()\n    compressed += compressor.compress(input_data[:10 * 128 * 1024])\n    compressed += compressor.compress(input_data[10 * 128 * 1024:])\n    compressed += compressor.flush()\nwith lz4.frame.LZ4FrameDecompressor() as decompressor:\n    decompressed = decompressor.decompress(compressed[:len(compressed)//2])\n    decompressed += decompressor.decompress(compressed[len(compressed)//2:])\ndecompressed == input_data\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function, lz4",
      "display": "def _lz4_compress(payload, **kwargs):\n    # Kafka does not support LZ4 dependent blocks\n    try:\n        # For lz4>=0.12.0\n        kwargs.pop('block_linked', None)\n        return lz4.compress(payload, block_linked=False, **kwargs)\n    except TypeError:\n        # For earlier versions of lz4\n        kwargs.pop('block_mode', None)\n        return lz4.compress(payload, block_mode=1, **kwargs)\n",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project function reference, lz4",
      "display": "codec.py · _lz4_compress()",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project repository, lz4",
      "display": "dpkp/kafka-python",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project stars, dpkp/kafka-python",
      "display": "5.9K",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Project push date, dpkp/kafka-python",
      "display": "Nov 2026",
      "asOf": "2026-11-11"
    },
    "F53": {
      "label": "Library name, cramjam",
      "display": "Cramjam",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Monthly downloads, cramjam",
      "display": "31.4M",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "License, cramjam",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Package release, cramjam",
      "display": "2.14.0, Oct 2026",
      "asOf": "2026-10-13"
    },
    "F57": {
      "label": "Package release date, cramjam",
      "display": "Oct 2026",
      "asOf": "2026-10-13"
    },
    "F58": {
      "label": "Repository stars, cramjam",
      "display": "130",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Incremental compression, cramjam",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "File-like objects, cramjam",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Compression levels, cramjam",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, cramjam",
      "display": "pip install cramjam numpy",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, cramjam",
      "display": "Bundles multiple compression algorithms behind Python bindings.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, cramjam",
      "display": "Offers multiple codec families",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, cramjam",
      "display": "Choose Snappy, Brotli, LZ4, Zstandard, and other codecs through one package.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, cramjam",
      "display": "Writes into supplied buffers",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, cramjam",
      "display": "Use compress_into and decompress_into with existing output storage.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, cramjam",
      "display": "Experimental codecs require source builds",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, cramjam",
      "display": "Enable each experimental feature when building from source.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, cramjam",
      "display": "Finishing consumes the streaming compressor",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, cramjam",
      "display": "Create another compressor after calling finish.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Quickstart, cramjam",
      "display": "import cramjam\nimport numpy as np\ncompressed = cramjam.snappy.compress(b\"bytes here\")\ndecompressed = cramjam.snappy.decompress(compressed)\ndecompressed\nbytes(decompressed)\nnp.frombuffer(decompressed, dtype=np.uint8)\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Library name, python-snappy",
      "display": "python-snappy",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Monthly downloads, python-snappy",
      "display": "10.9M",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "License, python-snappy",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Package release, python-snappy",
      "display": "0.7.3, Aug 2024",
      "asOf": "2024-08-29"
    },
    "F77": {
      "label": "Package release date, python-snappy",
      "display": "Aug 2024",
      "asOf": "2024-08-29"
    },
    "F78": {
      "label": "Repository stars, python-snappy",
      "display": "492",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Incremental compression, python-snappy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Incremental decompression, python-snappy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "File-like objects, python-snappy",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Install, python-snappy",
      "display": "pip install python-snappy",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "What it does, python-snappy",
      "display": "Provides Python bindings to the Snappy compression library from Google.",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths lead, python-snappy",
      "display": "Provides framed stream compression",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths, python-snappy",
      "display": "Use StreamCompressor for the Snappy framing format.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, python-snappy",
      "display": "Connects file-like input and output",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, python-snappy",
      "display": "Use stream_compress to copy and compress between readable and writable streams.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations lead, python-snappy",
      "display": "Chunk sizing belongs to callers",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "limitations, python-snappy",
      "display": "Buffer small inputs yourself before sending them to StreamCompressor.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, python-snappy",
      "display": "Stream decompression lacks length controls",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, python-snappy",
      "display": "Apply output limits outside the StreamDecompressor API.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart, python-snappy",
      "display": "python -m snappy -c uncompressed_file compressed_file.snappy\npython -m snappy -d compressed_file.snappy uncompressed_file\n",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project function, python-snappy",
      "display": "def snappy_encode(payload, xerial_compatible=True, xerial_blocksize=32*1024):\n    # ...\n\n    if not has_snappy():\n        raise NotImplementedError(\"Snappy codec is not available\")\n\n    if not xerial_compatible:\n        return snappy.compress(payload)\n\n    out = io.BytesIO()\n    for fmt, dat in zip(_XERIAL_V1_FORMAT, _XERIAL_V1_HEADER):\n        out.write(struct.pack('!' + fmt, dat))\n\n    # Chunk through buffers to avoid creating intermediate slice copies\n    if PYPY:\n        # on pypy, snappy.compress() on a sliced buffer consumes the entire\n        # buffer... likely a python-snappy bug, so just use a slice copy\n        chunker = lambda payload, i, size: payload[i:size+i]\n\n    else:\n        # snappy.compress does not like raw memoryviews, so we have to convert\n        # tobytes, which is a copy... oh well. it's the thought that counts.\n        # pylint: disable-msg=undefined-variable\n        chunker = lambda payload, i, size: memoryview(payload)[i:size+i].tobytes()\n\n    for chunk in (chunker(payload, i, xerial_blocksize)\n                  for i in range(0, len(payload), xerial_blocksize)):\n\n        block = snappy.compress(chunk)\n        block_size = len(block)\n        out.write(struct.pack('!i', block_size))\n        out.write(block)\n\n    return out.getvalue()\n",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project function reference, python-snappy",
      "display": "codec.py · snappy_encode()",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project repository, python-snappy",
      "display": "dpkp/kafka-python",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project stars, dpkp/kafka-python",
      "display": "5.9K",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project push date, dpkp/kafka-python",
      "display": "Nov 2026",
      "asOf": "2026-11-11"
    },
    "F98": {
      "label": "Developer need",
      "display": "Compressing repeated small records",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose zstandard",
      "display": "shared compression dictionaries",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "compressing repeated small records",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "When to consider lz4",
      "display": "the receiving application expects LZ4 frames",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "Exchanging interoperable LZ4 frames",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose lz4",
      "display": "frame interoperability",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "exchanging interoperable LZ4 frames",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider zstandard",
      "display": "repeated small records benefit from a shared dictionary",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Integrating framed Snappy streams",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose python-snappy",
      "display": "Snappy stream framing",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "integrating framed Snappy streams",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "When to consider cramjam",
      "display": "the application needs several codec families",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Developer need",
      "display": "Supporting multiple compression codecs",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Why choose cramjam",
      "display": "multiple codec families",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Developer need in introduction",
      "display": "supporting multiple compression codecs",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "When to consider zstandard",
      "display": "explicit Zstandard context reuse is a priority",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Page introduction",
      "display": "Python compression libraries let developers compress and decompress data.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Should large inputs use one-shot or streaming APIs?",
      "display": "python-zstandard one-shot operations require input and output to fit in memory together.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Should large inputs use one-shot or streaming APIs?",
      "display": "python-lz4 also provides chunked compression and decompression.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Can one Zstandard context serve concurrent operations?",
      "display": "Use separate contexts for simultaneously active operations.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: When do shared compression dictionaries help?",
      "display": "Dictionaries exploit recurring patterns across similar small inputs.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Which frame API is intended for interoperability?",
      "display": "The frame binding is recommended for exchanging data with other implementations.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Are content checksums enabled automatically?",
      "display": "Content checksum generation defaults to disabled; enable content_checksum when required.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Why can compression calls return empty output?",
      "display": "Default buffering can delay compressed output; auto_flush requests immediate output.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does the Snappy stream compressor choose chunk sizes?",
      "display": "StreamCompressor leaves chunk sizing and buffering to the caller.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Does Snappy stream decompression expose a maximum output length?",
      "display": "StreamDecompressor omits the max_length argument; enforce application output limits separately.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: What do the Kafka Snappy examples demonstrate?",
      "display": "The original encode function supports Xerial-compatible blocking.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Can Cramjam write into existing output storage?",
      "display": "Its codec variants expose compress_into and decompress_into.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Are experimental Cramjam codecs included in every installation?",
      "display": "Experimental features require a source build that enables each feature.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Can a Cramjam streaming compressor continue after finish?",
      "display": "Calling finish consumes the compressor state; create a new compressor afterward.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "Library name, zstandard",
      "display": "zstandard",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Monthly downloads, zstandard",
      "display": "194.6M",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "License, zstandard",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Package release, zstandard",
      "display": "0.25.0",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Package release date, zstandard",
      "display": "Sep 2025",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Install, zstandard",
      "display": "python -m pip install zstandard",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Quickstart, zstandard",
      "display": "import zstandard as zstd\n\ncompressed = zstd.compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Repository stars, zstandard",
      "display": "649",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Multiple codec families, zstandard",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Incremental codec context, zstandard",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Native format and framing, zstandard",
      "display": "Zstandard frames",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Runtime and first-call prerequisites, zstandard",
      "display": "Supported Python and compatible wheel/native build. One Zstandard frame; no Kafka host,worker,or benchmark executed.",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Exact external codec contract, zstandard",
      "display": "Native zstandard import owns ZstdDecompressor and returned reader. Current0.25 stream_reader accepts BytesIO source and read_across_frames=True; returned native ZstdDecompressionReader supports context manager/read(). BytesIO is a peer,not another SDK operation. Payload must contain valid matching Zstandard frames. Reads the entire decoded concatenated-frame Kafka payload into bytes,then closes native reader/source. This is not an output-size bound or an incremental-output consumer despite using a streaming decoder.",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Dictionary and worker API, zstandard",
      "display": "Native train_dictionary and ZstdCompressionDict APIs; ZstdCompressor threads configures internal compression workers,distinct from sharing a context across Python threads.",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project function, zstandard",
      "display": "def zstd_decode(payload):\n    if not zstd:\n        raise NotImplementedError(\"Zstd codec is not available\")\n    with zstd.ZstdDecompressor().stream_reader(io.BytesIO(payload), read_across_frames=True) as reader:\n        return reader.read()\n",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project source file, zstandard",
      "display": "kafka/codec.py",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project full_name, zstandard",
      "display": "dpkp/kafka-python",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project stargazers_count, zstandard",
      "display": "5.9K",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Library name, brotli",
      "display": "Brotli",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Monthly downloads, brotli",
      "display": "123.5M",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "License, brotli",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Package release, brotli",
      "display": "1.2.1",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Package release date, brotli",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Install, brotli",
      "display": "python -m pip install brotli",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Quickstart, brotli",
      "display": "import brotli\n\ncompressed = brotli.compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Official description, brotli",
      "display": "Binds the Brotli compression library for Python.",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Quickstart source file, brotli",
      "display": "python/brotli.py",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Repository stars, brotli",
      "display": "15.1K",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Multiple codec families, brotli",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Incremental codec context, brotli",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Native format and framing, brotli",
      "display": "Brotli streams",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Runtime and first-call prerequisites, brotli",
      "display": "Supported CPython/Python binding build. One Brotli byte stream; no HTTP server required.",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Exact external codec contract, brotli",
      "display": "Literal brotli import branch,not optional brotlicffi. Original constructor binds _decompress to native Decompressor.process for that branch; assignment preserves Python bound receiver. process accepts the data bytes. Native brotli.error maps to host DecodingError. Empty chunks return empty bytes; otherwise returns native decoded chunk and records seen_data. This function does not finish/validate the whole stream or certify sibling optional-codec paths.",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project function, brotli",
      "display": "def decode(self, data: bytes) -> bytes:\n        if not data:\n            return b\"\"\n        self.seen_data = True\n        try:\n            return self._decompress(data)\n        except brotli.error as exc:\n            raise DecodingError(str(exc)) from exc\n",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project source file, brotli",
      "display": "httpx/_decoders.py",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project full_name, brotli",
      "display": "encode/httpx",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project stargazers_count, brotli",
      "display": "15.8K",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Library name, lz4",
      "display": "LZ4",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Monthly downloads, lz4",
      "display": "84.9M",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "License, lz4",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Package release, lz4",
      "display": "4.4.5",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Package release date, lz4",
      "display": "Nov 2025",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Install, lz4",
      "display": "python -m pip install lz4",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Quickstart, lz4",
      "display": "import lz4.frame\n\ncompressed = lz4.frame.compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Repository stars, lz4",
      "display": "306",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Multiple codec families, lz4",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Incremental codec context, lz4",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Native format and framing, lz4",
      "display": "LZ4 block/frame formats; example uses framed file I/O",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Runtime and first-call prerequisites, lz4",
      "display": "Supported Python>=3.9 and compatible native wheel/build. Framed LZ4 output,not a bare LZ4 block.",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Exact external codec contract, lz4",
      "display": "Original initializer assigns directly imported lz4.frame.LZ4FrameFile to fileobj_factory. Current4.4.5 accepts a path/file object,wb mode,and optional compression_level. Existing version check accepts current4.4.5. Caller level must be a supported native value. Returns native framed compressor file,not already compressed bytes. Caller writes/closes it to finalize the frame. Default branch omits compression_level; configured branch forwards it. Host _check_versions is not another SDK call.",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project function, lz4",
      "display": "def compressor_file(self, fileobj, compresslevel=None):\n        \"\"\"Returns an instance of a compressor file object.\"\"\"\n        self._check_versions()\n        if compresslevel is None:\n            return self.fileobj_factory(fileobj, \"wb\")\n        else:\n            return self.fileobj_factory(fileobj, \"wb\", compression_level=compresslevel)\n",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project source file, lz4",
      "display": "joblib/compressor.py",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project full_name, lz4",
      "display": "joblib/joblib",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Project stargazers_count, lz4",
      "display": "4.4K",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Library name, backports.zstd",
      "display": "backports.zstd",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Monthly downloads, backports.zstd",
      "display": "59.1M",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "License, backports.zstd",
      "display": "PSF-2.0",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Package release, backports.zstd",
      "display": "1.8.0",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Package release date, backports.zstd",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Install, backports.zstd",
      "display": "python -m pip install \"backports.zstd; python_version < '3.14'\"",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Quickstart, backports.zstd",
      "display": "import sys\n\nif sys.version_info >= (3, 14):\n    from compression import zstd\nelse:\n    from backports import zstd\n\ncompressed = zstd.compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Official description, backports.zstd",
      "display": "Backports the compression.zstd module.",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Quickstart source file, backports.zstd",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Repository stars, backports.zstd",
      "display": "31",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Multiple codec families, backports.zstd",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Incremental codec context, backports.zstd",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Native format and framing, backports.zstd",
      "display": "Zstandard with standard-library-compatible API",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Runtime and first-call prerequisites, backports.zstd",
      "display": "Backport1.8 supports Python3.10–3.13; Python>=3.14 uses its separate optional standard-library module,which must be present in that interpreter build. Conditional install marker avoids incompatible backport installation.",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Exact external codec contract, backports.zstd",
      "display": "Source explicitly imports backports.zstd on Python<3.14; standard-library3.14 branch is a separate compatible source mode. Selected1.8 requires Python3.10–3.13. Its own README delegates API to Python3.14 reference. Native decompress accepts max_length and exposes eof,unused_data,needs_input; resets create genuine contexts. Returns accumulated bytes across frames while honoring original per-call max_length loop. EOF leftovers and internally buffered output are distinct; original has_unconsumed_tail host property is required. No total lifetime/output-memory bound asserted.",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Standard-library API alignment, backports.zstd",
      "display": "Own README delegates to Python3.14 API,which names dictionary helpers train_dict/finalize_dict and advanced worker parameter CompressionParameter.nb_workers. These names differ from dedicated zstandard train_dictionary/threads.",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project function, backports.zstd",
      "display": "def decompress(self, data: bytes, max_length: int = -1) -> bytes:\n            if not data and not self.has_unconsumed_tail:\n                return b\"\"\n            if self._obj.eof:\n                data = self._obj.unused_data + data\n                self._obj = zstd.ZstdDecompressor()\n            part = self._obj.decompress(data, max_length=max_length)\n            length = len(part)\n            data_parts = [part]\n            # Every loop iteration is supposed to read data from a separate frame.\n            # The loop breaks when:\n            #   - enough data is read;\n            #   - no more unused data is available;\n            #   - end of the last read frame has not been reached (i.e.,\n            #     more data has to be fed).\n            while (\n                self._obj.eof\n                and self._obj.unused_data\n                and (max_length < 0 or length < max_length)\n            ):\n                unused_data = self._obj.unused_data\n                if not self._obj.needs_input:\n                    self._obj = zstd.ZstdDecompressor()\n                part = self._obj.decompress(\n                    unused_data,\n                    max_length=(max_length - length) if max_length > 0 else -1,\n                )\n                if part_length := len(part):\n                    data_parts.append(part)\n                    length += part_length\n                elif self._obj.needs_input:\n                    break\n            return b\"\".join(data_parts)\n",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project source file, backports.zstd",
      "display": "src/urllib3/response.py",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Project full_name, backports.zstd",
      "display": "urllib3/urllib3",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Project stargazers_count, backports.zstd",
      "display": "4.1K",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Library name, zopfli",
      "display": "Zopfli",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Monthly downloads, zopfli",
      "display": "44.9M",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "License, zopfli",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Package release, zopfli",
      "display": "0.4.3",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Package release date, zopfli",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Install, zopfli",
      "display": "python -m pip install zopfli",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Quickstart, zopfli",
      "display": "from zopfli.zlib import compress\n\ncompressed = compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Official description, zopfli",
      "display": "Provides the Zopfli compressor for Python.",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Quickstart source file, zopfli",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Repository stars, zopfli",
      "display": "16",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Multiple codec families, zopfli",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Incremental codec context, zopfli",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Native format and framing, zopfli",
      "display": "zlib/gzip-wrapped Deflate in documented Python codec wrappers",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Runtime and first-call prerequisites, zopfli",
      "display": "Python>=3.10. Bytes recipe replaces obsolete Python2 string style in publisher README; current compression method/iteration contract is retained. Output is zlib-wrapped Deflate,not gzip.",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Exact external codec contract, zopfli",
      "display": "Only opt-in USE_ZOPFLI=True and nonzero validated level branch owns selected zopfli.zlib.compress. Current0.4.3 accepts bytes and integer numiterations from original ZOPFLI_LEVELS. Sibling level0/default-zlib branch is standard library,not a second Zopfli call; direct positional zlib level is not misrepresented as Zopfli API. Returns zlib-wrapped Deflate bytes,not gzip or an archive. Original level0–9 is the host selector for iteration counts,not a universal native Zopfli level API. No performance/rate claim adopted from source docstring.",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Project function, zopfli",
      "display": "def compress(data, level=ZLIB_COMPRESSION_LEVEL):\n    \"\"\"Compress 'data' to Zlib format. If 'USE_ZOPFLI' variable is True,\n    zopfli is used instead of the zlib module.\n    The compression 'level' must be between 0 and 9. 1 gives best speed,\n    9 gives best compression (0 gives no compression at all).\n    The default value is a compromise between speed and compression (6).\n    \"\"\"\n    if not (0 <= level <= 9):\n        raise ValueError(\"Bad compression level: %s\" % level)\n    if not USE_ZOPFLI or level == 0:\n        from zlib import compress\n\n        return compress(data, level)\n    else:\n        from zopfli.zlib import compress\n\n        return compress(data, numiterations=ZOPFLI_LEVELS[level])\n",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Project source file, zopfli",
      "display": "Lib/fontTools/ttLib/sfnt.py",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Project full_name, zopfli",
      "display": "fonttools/fonttools",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Project stargazers_count, zopfli",
      "display": "5.3K",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Library name, cramjam",
      "display": "cramjam",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Monthly downloads, cramjam",
      "display": "31.9M",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "License, cramjam",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Package release, cramjam",
      "display": "2.14.0",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Package release date, cramjam",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Install, cramjam",
      "display": "python -m pip install cramjam",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Quickstart, cramjam",
      "display": "import cramjam\n\ncompressed = bytes(cramjam.snappy.compress(b\"hello\"))\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Repository stars, cramjam",
      "display": "130",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Multiple codec families, cramjam",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Incremental codec context, cramjam",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Native format and framing, cramjam",
      "display": "Multiple codec submodules,including raw/framed Snappy,Brotli,LZ4,Zstandard,and others according to build features",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Runtime and first-call prerequisites, cramjam",
      "display": "Python>=3.11 and standard Snappy-enabled distribution. Native framed Snappy returns Buffer; bytes() gives ordinary bytes. Raw Snappy has separate compress_raw/decompress_raw methods.",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Exact external codec contract, cramjam",
      "display": "Original alias directly binds cramjam.snappy.decompress_raw. Current2.14 exact tag accepts bytes-like data and returns Buffer; bytes() conversion is documented. This is RAW Snappy,not default framed snappy.decompress. Native DecompressionError is translated to host UncompressError; builtin bytes/str.decode are not SDK calls. Returns bytes,or decoded str when optional decoding is supplied. Text input is rejected and text-decoding errors remain Python codec errors. Matching raw-Snappy input is required. No claim newer README output-limit option exists in selected binary.",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Streaming and Buffer returns, cramjam",
      "display": "Published Snappy Compressor.compress writes into the retained stream and returns a byte-count; finish returns Buffer. One-shot raw functions return Buffer,and bytes() performs the documented conversion.",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Output-limit publication conflict, cramjam",
      "display": "Current GitHub/master README advertises max_output_size,but retained v2.14.0 source/README expose older signatures without that option. Selected binary support is unverified; do not claim a hard output cap from the current README alone. Example uses only common documented raw-Snappy API.",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Library name, inflate64",
      "display": "inflate64",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Monthly downloads, inflate64",
      "display": "12.0M",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "License, inflate64",
      "display": "LGPL-2.1-or-later",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Package release, inflate64",
      "display": "1.0.4",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Package release date, inflate64",
      "display": "Nov 2025",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Install, inflate64",
      "display": "python -m pip install inflate64",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Quickstart, inflate64",
      "display": "import inflate64\n\ncompressor = inflate64.Deflater()\ncompressed = compressor.deflate(b\"hello\") + compressor.flush()\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Official description, inflate64",
      "display": "Compresses and decompresses Deflate64 data.",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Quickstart source file, inflate64",
      "display": "README.rst",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Repository stars, inflate64",
      "display": "2",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Multiple codec families, inflate64",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Incremental codec context, inflate64",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Native format and framing, inflate64",
      "display": "Enhanced Deflate / Deflate64 payloads",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Runtime and first-call prerequisites, inflate64",
      "display": "Supported Python>=3.9/native build. Flush finalizes Enhanced Deflate/Deflate64 payload; this does not create a ZIP/7z archive.",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Exact external codec contract, inflate64",
      "display": "Original initializer creates inflate64.Inflater on supported CPython branch. Current1.0.4 inflate accepts supplied contiguous bytes-like chunks,including empty drain input. The host max_length parameter is NOT forwarded/used,so no native limit is asserted for this wrapper. Returns decoded bytes; the first empty input drains once and later empty inputs return empty bytes according to original flushed flag. PyPy is explicitly disabled by host. Input is Enhanced Deflate payload,not a complete ZIP/7z archive.",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Project function, inflate64",
      "display": "def decompress(self, data: bytes | bytearray | memoryview, max_length: int = -1) -> bytes:\n        if not self._enabled:\n            raise UnsupportedCompressionMethodError(None, \"deflate64 is disabled on pypy.\")\n        if len(data) == 0:\n            if self.flushed:\n                return b\"\"\n            else:\n                self.flushed = True\n                return self._decompressor.inflate(b\"\")\n        return self._decompressor.inflate(data)\n",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Project source file, inflate64",
      "display": "py7zr/compressor.py",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Project full_name, inflate64",
      "display": "miurahr/py7zr",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Project stargazers_count, inflate64",
      "display": "561",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Library name, pyppmd",
      "display": "PyPPMd",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Monthly downloads, pyppmd",
      "display": "11.6M",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "License, pyppmd",
      "display": "LGPL-2.1-or-later",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Package release, pyppmd",
      "display": "1.3.1",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Package release date, pyppmd",
      "display": "Nov 2025",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Install, pyppmd",
      "display": "python -m pip install pyppmd",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Quickstart, pyppmd",
      "display": "import pyppmd\n\ncompressed = pyppmd.compress(b\"hello\")\nprint(compressed)\n",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Official description, pyppmd",
      "display": "Compresses and decompresses PPMd data.",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Quickstart source file, pyppmd",
      "display": "src/pyppmd/__init__.py",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Repository stars, pyppmd",
      "display": "12",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Multiple codec families, pyppmd",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Incremental codec context, pyppmd",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Native format and framing, pyppmd",
      "display": "PPMd7/H and PPMd8/I variant streams",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Runtime and first-call prerequisites, pyppmd",
      "display": "Supported Python>=3.10/native build. Public high-level helper defaults to PPMd variantI; matching variant/order/memory settings are needed to decode. Not a self-describing .7z archive.",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Exact external codec contract, pyppmd",
      "display": "Actual receiver is native Ppmd7Decoder(order,mem) parsed from7z properties. Current1.3.1 requires data and integer length; C implementation explicitly maps negative length to INT_MAX,so original -1 is supported implementation behavior. Positive limits must fit C int. needs_input is public state; matching model properties and a valid initial compressed chunk are required before empty-input sentinel handling. Returns decoded bytes from current PPMd7/H decoder; an empty input with needs_input feeds one null byte per documented extra-byte behavior. First initialization requires at least5 input bytes by published C implementation. This is not a .7z parser or a general resource-bound proof.",
      "asOf": "2026-11-20"
    },
    "F270": {
      "label": "Project function, pyppmd",
      "display": "def decompress(self, data: bytes | bytearray | memoryview, max_length=-1) -> bytes:\n        if len(data) == 0 and self.decoder.needs_input:\n            return self.decoder.decode(b\"\\0\", max_length)\n        return self.decoder.decode(data, max_length)\n",
      "asOf": "2026-11-20"
    },
    "F271": {
      "label": "Project source file, pyppmd",
      "display": "py7zr/compressor.py",
      "asOf": "2026-11-20"
    },
    "F272": {
      "label": "Project full_name, pyppmd",
      "display": "miurahr/py7zr",
      "asOf": "2026-11-20"
    },
    "F273": {
      "label": "Project stargazers_count, pyppmd",
      "display": "561",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python compression libraries zstandard lz4 python-snappy Cramjam code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
