# pyodc
[![PyPI](https://img.shields.io/pypi/v/pyodc)](https://pypi.org/project/pyodc/)
[![Build Status](https://img.shields.io/github/workflow/status/ecmwf/pyodc/Continuous%20Integration/develop)](https://github.com/ecmwf/pyodc/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/pyodc/badge/?version=latest)](https://pyodc.readthedocs.io/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Licence](https://img.shields.io/github/license/ecmwf/pyodc)](https://github.com/ecmwf/pyodc/blob/develop/LICENSE)
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]
## Dependencies
### Required
* Python 3.x
### Optional
* [odc]
* [pytest]
* [pandoc]
* [Jupyter Notebook]
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 the `odc_DIR` or `ODC_DIR` environment variables, or the library directory can be included in `LD_LIBRARY_PATH`.
## Installation
```sh
pip install --user pyodc
```
Check if the module was installed correctly:
```sh
python
>>> import pyodc
>>> import codc # optional
```
## Usage
An introductory Jupyter Notebook with helpful usage examples is provided in the root of this repository:
```sh
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:
```sh
python -m pytest
```
### Build Documentation
To build the documentation locally, please install the Python dependencies first:
```sh
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.
[Documentation]: https://pyodc.readthedocs.io/en/latest/
[Changelog]: ./CHANGELOG.md
[odc]: https://github.com/ecmwf/odc
[pytest]: https://pytest.org
[pandoc]: https://pandoc.org/
[Jupyter Notebook]: https://jupyter.org
# Changelog for pyodc
## 1.1.3
* Improved github/ci integration
## 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 `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
## 1.0.4
* Correct support for constant codecs
* Decoding by column short name
## 1.0.3
* Specify `odc` library location with `odc/ODC_DIR`
* Correct `setup.py` dependencies to include pandas
* Support missing ConstantString values encoded from ODB1 using the `odb_migrator`
## 1.0.2
* 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 `codb.py` into a full `codc` module
* Fix miscellaneous bugs
## 1.0.1
* Fixed automatic selection of integral codecs
## 1.0.0
* Initial version
[#6]: https://github.com/ecmwf/pyodc/issues/6
[ODB-534]: https://jira.ecmwf.int/browse/ODB-534
[ODB-533]: https://jira.ecmwf.int/browse/ODB-533
[ODB-530]: https://jira.ecmwf.int/browse/ODB-530
[ODB-525]: https://jira.ecmwf.int/browse/ODB-525
[ODB-524]: https://jira.ecmwf.int/browse/ODB-524
[ODB-523]: https://jira.ecmwf.int/browse/ODB-523
Raw data
{
"_id": null,
"home_page": "https://github.com/ecmwf/pyodc",
"name": "pyodc",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "odc odb",
"author": "European Centre for Medium-Range Weather Forecasts (ECMWF)",
"author_email": "software.support@ecmwf.int",
"download_url": "https://files.pythonhosted.org/packages/42/f8/a785bf6539e69ca602dcde06b09187c5b0c6a33bb63eebdeda7c25ec905b/pyodc-1.4.1.tar.gz",
"platform": null,
"description": "# pyodc\n\n[![PyPI](https://img.shields.io/pypi/v/pyodc)](https://pypi.org/project/pyodc/)\n[![Build Status](https://img.shields.io/github/workflow/status/ecmwf/pyodc/Continuous%20Integration/develop)](https://github.com/ecmwf/pyodc/actions/workflows/ci.yml)\n[![Documentation Status](https://readthedocs.org/projects/pyodc/badge/?version=latest)](https://pyodc.readthedocs.io/en/latest/?badge=latest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Licence](https://img.shields.io/github/license/ecmwf/pyodc)](https://github.com/ecmwf/pyodc/blob/develop/LICENSE)\n\nA Python interface to `odc` for encoding/decoding ODB\\-2 files.\n\nThe package contains two different implementations of the same library:\n\n* `pyodc` is a pure-python encoder and decoder for ODB\\-2 data, which encodes data from, and decodes it into pandas data frames\n* `codc` is an implementation of the same API as `pyodc` that depends on the ECMWF `odc` library, and comes with _much_ better performance\n\n[Documentation] [Changelog]\n\n## Dependencies\n\n### Required\n\n* Python 3.x\n\n### Optional\n\n* [odc]\n* [pytest]\n* [pandoc]\n* [Jupyter Notebook]\n\nFor `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 the `odc_DIR` or `ODC_DIR` environment variables, or the library directory can be included in `LD_LIBRARY_PATH`.\n\n## Installation\n\n```sh\npip install --user pyodc\n```\n\nCheck if the module was installed correctly:\n\n```sh\npython\n>>> import pyodc\n>>> import codc # optional\n```\n\n## Usage\n\nAn introductory Jupyter Notebook with helpful usage examples is provided in the root of this repository:\n\n```sh\ngit clone git@github.com:ecmwf/pyodc.git\ncd pyodc\njupyter notebook Introduction.ipynb\n```\n\n## Development\n\n### Run Unit Tests\n\nTo run the unit tests, make sure that the `pytest` module is installed first:\n\n```sh\npython -m pytest\n```\n\n### Build Documentation\n\nTo build the documentation locally, please install the Python dependencies first:\n\n```sh\ncd docs\npip install -r requirements.txt\nmake html\n```\n\nThe built HTML documentation will be available under the `docs/_build/html/index.html` path.\n\n## License\n\nThis 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.\n\nIn 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.\n\n[Documentation]: https://pyodc.readthedocs.io/en/latest/\n[Changelog]: ./CHANGELOG.md\n[odc]: https://github.com/ecmwf/odc\n[pytest]: https://pytest.org\n[pandoc]: https://pandoc.org/\n[Jupyter Notebook]: https://jupyter.org\n\n# Changelog for pyodc\n\n## 1.1.3\n\n* Improved github/ci integration\n\n## 1.1.2\n\n* Fixed [#6]: pip install breaks codc\n\n## 1.1.1\n\n* Fixed [ODB-534]: PyPI package is missing CHANGELOG\n\n## 1.1.0\n\n* Fixed [ODB-533]: Decode data starting with missing values correctly\n* Fixed [ODB-530]: Bitfield column inspection returns incomplete data in pure-Python implementation\n* Bumped up required `odc` version number to 1.4.0\n* Added missing frame properties accessor to `codc` interface\n* Fixed [ODB-525]: Setting odc prefix variable (`odc_DIR`) does not work as expected on macOS\n* Fixed [ODB-524]: Keys and values in decoded frame properties are switched on older Python version\n* Added test flag to skip `codc` tests on demand (`PYODC_SKIP_CODC`)\n* Fixed [ODB-523]: Additional properties parameter is omitted in encode_odb() when string is passed as file\n* Fixed package setup metadata\n* Added documentation\n\n## 1.0.4\n\n* Correct support for constant codecs\n* Decoding by column short name\n\n## 1.0.3\n\n* Specify `odc` library location with `odc/ODC_DIR`\n* Correct `setup.py` dependencies to include pandas\n* Support missing ConstantString values encoded from ODB1 using the `odb_migrator`\n\n## 1.0.2\n\n* String missing values should be `None` not `NaN`\n* Refactor oneshot behaviour (`read_odb_oneshot` --> `read_odb(..., single=True)`)\n* Raise correct error on `odc` not found\n* Split `codb.py` into a full `codc` module\n* Fix miscellaneous bugs\n\n## 1.0.1\n\n* Fixed automatic selection of integral codecs\n\n## 1.0.0\n\n* Initial version\n\n\n[#6]: https://github.com/ecmwf/pyodc/issues/6\n[ODB-534]: https://jira.ecmwf.int/browse/ODB-534\n[ODB-533]: https://jira.ecmwf.int/browse/ODB-533\n[ODB-530]: https://jira.ecmwf.int/browse/ODB-530\n[ODB-525]: https://jira.ecmwf.int/browse/ODB-525\n[ODB-524]: https://jira.ecmwf.int/browse/ODB-524\n[ODB-523]: https://jira.ecmwf.int/browse/ODB-523\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0",
"summary": "A Python interface to odc for encoding/decoding ODB-2 files.",
"version": "1.4.1",
"project_urls": {
"Homepage": "https://github.com/ecmwf/pyodc"
},
"split_keywords": [
"odc",
"odb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "42f8a785bf6539e69ca602dcde06b09187c5b0c6a33bb63eebdeda7c25ec905b",
"md5": "abe5fde31ec26f6f4e4b13c90d58c734",
"sha256": "faf5f348d053a0b5e8a4c14fe01f0fb2fbf8729bee1dcdadd660b23d01e4b8ab"
},
"downloads": -1,
"filename": "pyodc-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "abe5fde31ec26f6f4e4b13c90d58c734",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36998,
"upload_time": "2024-05-23T14:42:55",
"upload_time_iso_8601": "2024-05-23T14:42:55.385327Z",
"url": "https://files.pythonhosted.org/packages/42/f8/a785bf6539e69ca602dcde06b09187c5b0c6a33bb63eebdeda7c25ec905b/pyodc-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-23 14:42:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ecmwf",
"github_project": "pyodc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "cffi",
"specs": []
},
{
"name": "findlibs",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "pytest-cov",
"specs": []
},
{
"name": "pytest-flakes",
"specs": []
}
],
"lcname": "pyodc"
}