Python 3.6+ compatible interface to ECMWF's ODB API
Project description
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 for "encoding and processing of observational data." The ODB API 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 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:
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 for more details.
References
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.