The csv2bufr module relies on the ecCodes software library to perform the BUFR encoding. This needs to be installed prior to installing any of the Python packages, instructions can be found on the ecCodes documentation pages:

The following Python packages are required by the csv2bufr module:

  • eccodes (NOTE: this is separate from the ecCodes library)

Additionally, the command line interface to csv2bufr requires:

All the above packages can be installed by running:

pip install -r requirements.txt



The quickest way to install and run the software is via a Docker image containing all the required libraries and Python modules:

docker pull wmoim/csv2bufr

This installs a Docker image based on Ubuntu and includes the ecCodes software library, dependencies noted above and the csv2bufr module (including the command line interface).


Alternatively, csv2bufr can be installed from source. First clone the repository and navigate to the cloned folder / directory:

git clone -b dev
cd csv2bufr

If running in a Docker environment, build the Docker image and run the container:

docker build -t csv2bufr .
docker run -it -v ${pwd}:/app csv2bufr
cd /app

The above step can be skipped if not using Docker. Now install the module and test:

python3 install
csv2bufr --help

The following output should be shown:

Usage: csv2bufr [OPTIONS] COMMAND [ARGS]...


  --version  Show the version and exit.
  --help     Show this message and exit.

  data      data workflows
  mappings  stored mappings

Environment variables

Three environment variables are defined and can be used to set the originating centre and sub centre of the generated BUFR files and the system search path used to find BUFR mapping templates(see BUFR template page)

  • BUFR_ORIGINATING_CENTRE: Specifies the originating centre of the BUFR data, Common Code Table C-11

  • BUFR_ORIGINATING_SUBCENTRE: Specifies the originating sub centre of the BUFR data, Common Code Table C-12

  • CSV2BUFR_TEMPLATES: Path to search for BUFR templates