Metadata-Version: 2.1
Name: py3odb
Version: 0.1.1
Summary: Python 3.6+ compatible interface to ECMWF's ODB API
Home-page: https://github.com/opus49/py3odb
Author: Mike Puskar
Author-email: puskar49@gmail.com
License: MIT
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.6
Description-Content-Type: text/markdown

[![build](https://img.shields.io/circleci/build/github/opus49/py3odb)](https://circleci.com/gh/opus49/py3odb)
[![codecov](https://img.shields.io/codecov/c/github/opus49/py3odb)](https://codecov.io/gh/opus49/py3odb)
[![PyPI](https://img.shields.io/pypi/v/py3odb?color=blue)](https://pypi.org/project/py3odb/)
[![Python](https://img.shields.io/pypi/pyversions/py3odb)](https://www.python.org/downloads/release/python-360/)


# py3odb
Python 3.6+ compatible interface to ECMWF's ODB API


## Overview
ODB API was developed by the [European Centre for Medium-Range Weather Forecasts](https://www.ecmwf.int/) for "encoding and processing of observational data."  The [ODB API](https://confluence.ecmwf.int/display/ODBAPI) provides an SQL-like interface called odbsql, along with a Python 2 compatible API.  

This module was written to provide an interface to ODB API using Python >=3.6.  It requires access to libOdb provided by ODB API.


## Known Limitations
The intent of this library is to read odb2 files generated by the [Unified Model](https://www.metoffice.gov.uk/) for the purpose of observation monitoring.  The underlying odbql interface to the ODB API provided by ECMWF does not support database operations in a traditional sense.  For example:
* as of ODB API version 17.6, odbql only supports 8 character strings
* only the most recent INSERT command is accepted
* you cannot open an existing odb file and do an INSERT


## Usage
py3odb follows the [Python Database API Specification](https://www.python.org/dev/peps/pep-0249):

    import py3odb
    connection = py3odb.connect('foo.db')
    cursor = connection.cursor()
    cursor.execute('SELECT * FROM "foo.db"')
    for row in cursor:
        print(row)
    connection.close()

See [PEP 249](https://www.python.org/dev/peps/pep-0249) for more details.


## References
* https://www.python.org/dev/peps/pep-0249
* https://confluence.ecmwf.int/display/ODBAPI


