{"categories":[{"label":"Utilities","url":"https://skillfed.io/packages/category/utilities/4"}],"enrichment":{"capability":"xopen provides a drop-in replacement for Python's built-in open() that transparently handles compressed files in gzip, bzip2, xz, and Zstandard formats, automatically selecting efficient backends.","skillfed_tags":["compression","file-handling"],"use_cases":["Processing large compressed log files or data archives without decompressing to disk first.","Writing compressed output in a script without manually choosing and configuring a compression backend.","Reading files where compression format is unknown, relying on magic-byte detection.","Parallel compression/decompression of large files by leveraging multi-threaded backends.","Reproducible data pipelines that generate gzip files with consistent output across runs."],"what_it_does":"xopen is a file-opening utility that extends Python's built-in open() function to handle compressed files transparently. When you pass a filename with a recognized compression extension (.gz, .bz2, .xz, .zst), xopen automatically detects the format and opens it with an appropriate decompressor. For writing, the format is inferred from the filename extension; for reading, it can detect format from either the extension or the file's magic bytes. The package intelligently delegates to the most efficient available backend\u2014preferring specialized libraries like python-isal and python-zlib-ng for gzip, external tools like pigz and xz for parallel compression, and falling back to Python's standard library (gzip, lzma, bz2) when specialized backends are unavailable.\n\nThe API is intentionally minimal: a single xopen() function that accepts the same parameters as built-in open() plus compression-specific options like compresslevel and threads. By default, xopen spawns additional threads (up to four) to offload compression work from the main Python thread, though this can be disabled by setting threads=0. The package also ensures reproducible gzip output by stripping timestamps from headers. It's designed for workflows that need to read or write compressed files without coupling to a specific compression library or worrying about which backend is available.","worth_installing":"Yes. xopen is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It solves a genuine problem\u2014transparent compressed file handling\u2014with a minimal, stable API. The optional backends (isal, zlib-ng, backports.zstd) gracefully degrade if unavailable, so the package works out of the box. Suitable for any workflow involving compressed files."},"id":"xopen","links":{"html":"https://skillfed.io/packages/xopen","md":"https://skillfed.io/packages/xopen.md","pypi":"https://pypi.org/project/xopen/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-03","license_spdx":"MIT","license_treatment":"permissive","name":"xopen","python_support":"supports_current","summary":"Open compressed files transparently"},"popularity":{"monthly_downloads":822444,"position":4972,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.1.0"}
