Oracle Developers
Published in

Oracle Developers

Python-oracledb 1.2 has been released

Photo by Markus Spiske on Unsplash

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.

Main Changes

  • Binary packages were added for the new Python 3.11 release.
  • Support for binding and fetching data of type oracledb.DB_TYPE_OBJECT in 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.XMLTYPE data as strings. Unlike in Thick mode, fetching longer values does not require converting your queries to return a LOB with XMLTYPE.GETCLOBVAL().
    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.

python-oracledb References

Home page: oracle.github.io/python-oracledb/index.html

Installation instructions: python-oracledb.readthedocs.io/en/latest/installation.html

Documentation: python-oracledb.readthedocs.io/en/latest/index.html

Release Notes: python-oracledb.readthedocs.io/en/latest/release_notes.html

Discussions: github.com/oracle/python-oracledb/discussions

Issues: github.com/oracle/python-oracledb/issues

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!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Christopher Jones

Christopher Jones

67 Followers

Oracle Database Product Manager for language drivers including Python python-oracledb, Node.js node-oracledb, PHP OCI8 and more! On Mastodon: @cjbj@phpc.social