dcompressee: a small Python library to generate temporarirly decompressed files
Background
A common use case in Bioinformatics is having to temporarily decompress a file in
order to run it through some tool. For instance, blastn can only read uncompressed
FASTA files. This library provides a simple way to do this. The library will automatically
detect the compression format of the file and decompress it to a temporary file. The
temporary file will be automatically deleted when the program exits. The library
currently supports the following compression formats: gzip, bzip2, xz, lz4, and lzma.
Usage
from dcompressee import unpack
# A list of file paths as pathlib.Path objects with various compression formats,
# and some are not compressed
files = ["/path/to/file1.fasta.gz", "/path/to/file2.fasta.bz2", "/path/to/file3.fasta.xz", "/path/to/file4.fasta"]
# Generate a list of paths as pathlib.Path objects to temporarily decompressed
# files (these will be created in $TMPDIR) if necessary. For files that are not
# compressed, the function will return the original path.
# The created temporary files will be automaicallly deleted when the program exits.
paths = [unpack(f) for f in files]
Installation
pip install dcompressee
Examples
Two examples are provided in the examples directory. The first example shows how to
use dcompressee in a simple Python script. The second example shows how to use
dcompressee in a asynchronous manner.
Author
Anders Goncalves da Silva (@andersgs)
Metadata
Release files for dcompressee 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dcompressee-1.0.0.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dcompressee-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 kB
Release files / dcompressee-1.0.0.tar.gz
| Download URL | dcompressee-1.0.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd43bd530a8eda563b6cd47fd0201a2d3ef7367b7f5581d7b923e86d5f668562
|
|
BLAKE2b-256 checksum How to use checksums |
b5185aef1126aa7cabfe942dce9efe2661dda8b293e8160b8d3594e4ffa4bed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / dcompressee-1.0.0-py3-none-any.whl
| Download URL | dcompressee-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1cd9c00ccff8338b755674f49b7b390483083568c52611fdfaac71befe5deb0d
|
|
BLAKE2b-256 checksum How to use checksums |
f5a7720eca1f18e637d1946e2ac1d9f9922831d8c83273f8ec3e9931bf3043f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for dcompressee 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.