From C to PEP-249: A Database API Odyssey

Matt Wozniski

Abstract

Most databases natively support a C API. Python has a standard for what database APIs should look like: PEP-249. I'll discuss my experiences adapting one particular database's C API into a PEP-249 compliant module, including a few clever solutions to overcome issues I encountered.

Description

Most databases natively support a C API. Python has a standard for what database APIs should look like: PEP-249. I'll discuss my experiences adapting one particular database's C API into a PEP-249 compliant module, starting with building thin, Python-callable bindings to the C library and eventually implementing PEP-249's higher level abstractions on top of those low-level bindings. Along the way, I'll discuss several places where the database's behavior couldn't be easily adapted to the Python DB-API interface, and some clever solutions to bridging those gaps.

Bio

Matt is a Senior Software Developer on Bloomberg's Python Infrastructure team, where he uses Python, C, and C++ to improve the depth, breadth and health of Bloomberg's Python ecosystem.