A Python interface to odc for encoding/decoding ODB-2 files.
Project description
pyodc
A Python interface to odc for encoding/decoding ODB-2 files.
The package contains two different implementations of the same library:
pyodcis a pure-python encoder and decoder for ODB-2 data, which encodes data from, and decodes it into pandas data framescodcis an implementation of the same API aspyodcthat depends on the ECMWFodclibrary, and comes with much better performance
Dependencies
Required
- Python 3.x
Optional
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.
Installation
pip install --user pyodc
Check if the module was installed correctly:
python
>>> import pyodc
>>> import codc # optional
Usage
An introductory Jupyter Notebook with helpful usage examples is provided in the root of this repository:
git clone git@github.com:ecmwf/pyodc.git
cd pyodc
jupyter notebook Introduction.ipynb
Development
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.
License
This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
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
1.1.2
- Fixed #6: pip install breaks codc
1.1.1
- Fixed ODB-534: PyPI package is missing CHANGELOG
1.1.0
- 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
odcversion number to 1.4.0 - Added missing frame properties accessor to
codcinterface - 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
codctests 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
1.0.4
- Correct support for constant codecs
- Decoding by column short name
1.0.3
- Specify
odclibrary location withodc/ODC_DIR - Correct
setup.pydependencies to include pandas - Support missing ConstantString values encoded from ODB1 using the
odb_migrator
1.0.2
- String missing values should be
NonenotNaN - Refactor oneshot behaviour (
read_odb_oneshot-->read_odb(..., single=True)) - Raise correct error on
odcnot found - Split
codb.pyinto a fullcodcmodule - Fix miscellaneous bugs
1.0.1
- Fixed automatic selection of integral codecs
1.0.0
- Initial version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pyodc-1.1.2.tar.gz.
File metadata
- Download URL: pyodc-1.1.2.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94c57a36a94859959c5b1357b9883773713ebd3142ecd748b1110dde75e9022e
|
|
| MD5 |
0fff9e9718b9791b11e56679ead4d154
|
|
| BLAKE2b-256 |
4f362e1e36382fdd5e98d6f9bfc0001da97de519e9153b05658a3857a82daee6
|