Python-oracledb 1.2 has been released
python-oracledb 1.2, the extremely popular Oracle Database interface for Python, is now on PyPI.
python-oracledb is an open source package for the Python Database API specification with many additions to support advanced Oracle Database features. It is the new name for the cx_Oracle driver.
Another welcome patch release has landed, adding features that were previously only available in traditional ‘Thick’ mode (with Oracle Client Libraries). Other improvements and bug fixes were also made.
- Binary packages were added for the new Python 3.11 release.
- Support for binding and fetching data of type
oracledb.DB_TYPE_OBJECTin Thin mode. This was one of the top requests that was blocking people moving from Thick mode.
You can play with examples like this nice one that shows Oracle Database’s Spatial functionality: spatial_to_geopandas.py.
- Thin mode now has support for fetching
SYS.XMLTYPEdata as strings. Unlike in Thick mode, fetching longer values does not require converting your queries to return a LOB with
For examples, see the documentation: Using XMLTYPE Data
- Some connection string syntax and wallet enhancements were made to Thin mode at the request of users. These increase the number of environments that can migrate from Thick mode.
One other change I’ll mention is a new, runnable example load_csv.py showing loading from CSV files. The sample shows how the
batcherrors flag can be used to filter out ‘noisy’ data while still letting valid rows be inserted. Loading from CSVs is an FAQ so it is nice to have the example to augment our documentation on the topic.
See the Release Notes for more improvements and bug fixes.
Finally, do you want something interactive? Check out our ‘LiveLabs’ introduction to python-oracledb: Getting Started with Python and Oracle Database.
Installing or Upgrading python-oracledb
You can install or upgrade python-oracledb by running:
python -m pip install oracledb --upgrade
The pip options — proxy and — user may be useful in some environments. See python-oracledb Installation for details.
Home page: oracle.github.io/python-oracledb/index.html
Installation instructions: python-oracledb.readthedocs.io/en/latest/installation.html
Release Notes: python-oracledb.readthedocs.io/en/latest/release_notes.html
Source Code Repository: github.com/oracle/python-oracledb
If you’re curious about the goings-on of Oracle Developers in their natural habitat, come join us on our public Slack channel!