Skip to main content

A Python interface to odc for encoding/decoding ODB-2 files.

Project description


PyPI Build Status Documentation Status Code style: black Licence

A Python interface to odc for encoding/decoding ODB-2 files.

The package contains two different implementations of the same library:

  • pyodc is a pure-python encoder and decoder for ODB-2 data, which encodes data from, and decodes it into pandas data frames
  • codc is an implementation of the same API as pyodc that depends on the ECMWF odc library, and comes with much better performance

Documentation Changelog



  • Python 3.x


For codc to work, odc library must be compiled and installed on the system and made available to Python (through the CFFI mechanism) as a shared library. There are multiple ways to make the library visible to CFFI: it can be installed as a system library, the installation prefix can be passed in odc_DIR environment variable, or the library directory can be included in LD_LIBRARY_PATH.


pip install --user pyodc

Check if the module was installed correctly:

>>> import pyodc
>>> import codc # optional


An introductory Jupyter Notebook with helpful usage examples is provided in the root of this repository:

git clone
cd pyodc
jupyter notebook Introduction.ipynb


Run Unit Tests

To run the unit tests, make sure that the pytest module is installed first:

python -m pytest

Build Documentation

To build the documentation locally, please install the Python dependencies first:

cd docs
pip install -r requirements.txt
make html

The built HTML documentation will be available under the docs/_build/html/index.html path.


This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at

In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.

Changelog for pyodc


  • Fixed #6: pip install breaks codc


  • Fixed ODB-534: PyPI package is missing CHANGELOG


  • Fixed ODB-533: Decode data starting with missing values correctly
  • Fixed ODB-530: Bitfield column inspection returns incomplete data in pure-Python implementation
  • Bumped up required odc version number to 1.4.0
  • Added missing frame properties accessor to codc interface
  • Fixed ODB-525: Setting odc prefix variable (odc_DIR) does not work as expected on macOS
  • Fixed ODB-524: Keys and values in decoded frame properties are switched on older Python version
  • Added test flag to skip codc tests on demand (PYODC_SKIP_CODC)
  • Fixed ODB-523: Additional properties parameter is omitted in encode_odb() when string is passed as file
  • Fixed package setup metadata
  • Added documentation


  • Correct support for constant codecs
  • Decoding by column short name


  • Specify odc library location with odc/ODC_DIR
  • Correct dependencies to include pandas
  • Support missing ConstantString values encoded from ODB1 using the odb_migrator


  • String missing values should be None not NaN
  • Refactor oneshot behaviour (read_odb_oneshot --> read_odb(..., single=True))
  • Raise correct error on odc not found
  • Split into a full codc module
  • Fix miscellaneous bugs


  • Fixed automatic selection of integral codecs


  • Initial version

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

pyodc-1.1.2.tar.gz (26.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page