Skip to main content

build codecov PyPI Python docs

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.

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()

For single queries, there is a Reader context manager and <odb> tag:

import py3odb
with py3odb.Reader('foo.db', 'SELECT * FROM <odb>') as odb_reader:
    for row in odb_reader:
        print(row)

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

References

Metadata

Release files for py3odb 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py3odb 0.3
File Size Uploaded
py3odb-0.3.tar.gz 56.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py3odb 0.3
File Interpreter ABI Platform
py3odb-0.3-py3-none-any.whl Python 3 none any Details

Total release size: 93.1 kB

Release files / py3odb-0.3.tar.gz

Download URL py3odb-0.3.tar.gz
Size 56.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9034ee41732ebe73ad0cf384a5edd0102749caacc221b41bb76084a0806d0897
BLAKE2b-256 checksum
How to use checksums
3bfee3092d52060fb03e6f2ddc1e8457033f6e740b751323c922239a980f9efe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release files / py3odb-0.3-py3-none-any.whl

Download URL py3odb-0.3-py3-none-any.whl
Size 37.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5e54d02d05ac094b5f8ffe6db094c04563ce6e6dfd0d36099383af53aa7ce8d
BLAKE2b-256 checksum
How to use checksums
a44a129b1b10c20fd72fe0c222a1f25e077fc62592240b7a866564bea9481362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files

0.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page