Skip to main content

Python bindings for EUMETSAT's PublicDecompWT

Project description

pyPublicDecompWT

python versions wheel CI build

This package provides python bindings for some of EUMETSAT’s PublicDecompWT tools.

With pyPublicDecompWT compressed xRIT (HRIT/LRIT) files can now be decompressed in-memory, directly with python!
Currently, only bindings for the tool xRITDecompress are available, if you need other classes / libraries please open a pull-request.

This repository contains / mirrors the source code for the complete PublicDecompWT tool, as well. Additionally, we provide CMake build files. We tested the tool with linux and mac-os, but did not manage to build it with windows (happy to change that, please open a pull-request!)

Installation

Install pyxRITDecompress via pip:

pip install pyPublicDecompWT

The following command will verify if the installation succeeded:

python -c "import pyPublicDecompWT"

Requirements

Building from sources requires C/C++, including compiler and standard library support.

  • C/C++ Compiler, e.g. GNU-GCC
  • CMake

Usage

from pyPublicDecompWT import xRITDecompress

compressed_file = "test-data/compressed_ref/H-000-MSG4__-MSG4________-HRV______-000012___-202105260000-C_"
with open(compressed_file, mode="rb") as fh:
    buf = fh.read()

xRIT = xRITDecompress(buf)
uncompressed = xRIT.data()

xRITDecompress

To comply with the original PublicDecompWT project, the pyPublicDecompWT package provides a xRITDecompress executable as well. Our xRITDecompress script is a near drop-in replacement for the original.

There are two changes:

  • We are not writing Decompressed file ... to stdout
  • As per UNIX convention, the short option -s is separated by a space, not by a colon.

The former can be enabled by passing -v to xRITDecompress, however, the latter can't be emulated. Thus, the command line call has to be changed.

In addition to the -s option we added a positional argument files to enable batch processing of (multiple) files in a single call.

$ xRITDecompress --help
usage: xRITDecompress [-h] [--version] [-v] [-s FILE] [files ...]

Command line tool for manual decompression of HRIT/LRIT files.

positional arguments:
  files          Name of compressed HRIT/LRIT file(s)

options:
  -h, --help     show this help message and exit
  --version      show program`s version number and exit
  -v, --verbose  Verbose mode
  -s FILE        Name of compressed HRIT/LRIT file

Versioning Scheme

The versioning scheme of the python bindings is the PublicDecompWT version with the additional version of the python bindings.

Example: version 1 of the python bindings for PublicDecompWT version 2.8.1 is 2.8.1.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyPublicDecompWT-2.8.1.1.tar.gz (169.2 kB view hashes)

Uploaded Source

Built Distributions

pyPublicDecompWT-2.8.1.1-cp310-cp310-manylinux_2_24_x86_64.whl (310.2 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

pyPublicDecompWT-2.8.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyPublicDecompWT-2.8.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (353.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyPublicDecompWT-2.8.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (354.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page