Jupyter notebooks showing best practices for using cx_Oracle, the Python DB API for Oracle Database

Overview

Python cx_Oracle Notebooks, 2022

The repository contains Jupyter notebooks showing best practices for using cx_Oracle, the Python DB API for Oracle Database.

I am releasing them one-by-one.

The final list of notebooks will be:

  • Connecting
  • Queries
  • DML
  • CSV
  • JSON and SODA
  • PL/SQL
  • Objects

You may also be interested in the tutorial Python and Oracle Database Tutorial: Scripting for the Future. This is also found in "LiveLabs" format here, which lets you easily run it in Oracle Cloud.

Setup

An existing Oracle Database is required.

The JSON demo assumes Oracle Database and Oracle Client are 21c.

Install Python 3

See https://www.python.org/downloads/

Install Jupyter

See https://jupyter.org/install:

pip install notebook

Install cx_Oracle

See https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html:

pip install cx_Oracle

Install some libraries used by the examples:

pip install numpy matplotlib

To setup the cx_Oracle sample tables

On macOS set up libclntsh by finding the library directory

python
import cx_Oracle
cx_Oracle
exit()

With the appropriate path from above, create a sym link:

ln -s $HOME/Downloads/instantclient_19_8/libclntsh.dylib $HOME/.local/lib/python3.9/site-packages/

Create the cx_Oracle sample schema

Clone/download https://github.com/oracle/python-cx_Oracle/tree/master/samples

git clone https://github.com/oracle/python-cx_Oracle.git
rm -rf python-cx_Oracle/doc python-cx_Oracle/odpi python-cx_Oracle/src python-cx_Oracle/test python-cx_Oracle/*.* python-cx_Oracle/.git*

cd python-cx_Oracle/samples

Review python-cx_Oracle/samples/README.md

Edit python-cx_Oracle/samples/sample_env.py and set desired credentials and connection string

export CX_ORACLE_SAMPLES_MAIN_USER=pythondemo
export CX_ORACLE_SAMPLES_MAIN_PASSWORD=welcome
export CX_ORACLE_SAMPLES_EDITION_USER=pythoneditions
export CX_ORACLE_SAMPLES_EDITION_PASSWORD=welcome
export CX_ORACLE_SAMPLES_EDITION_NAME=python_e1
export CX_ORACLE_SAMPLES_CONNECT_STRING=localhost/orclpdb1
export CX_ORACLE_SAMPLES_DRCP_CONNECT_STRING=localhost/orclpdb1:pooled
export CX_ORACLE_SAMPLES_ADMIN_USER=system
export CX_ORACLE_SAMPLES_ADMIN_PASSWORD=oracle

Install the schema

python setup_samples.py

Start Jupyter:

cd ../..
jupyter notebook

Load each notebook *.ipynb file and step through it

Before running the notebooks cells, edit the connect string(s) near the top of each notebook.

The Connection notebook has an example that connects to Oracle Cloud. The wallet setup shown in the notebook is needed for this to be runnable. Also run export CLOUD_PASSWORD="whatever" before starting that notebook.

Owner
Christopher Jones
https://twitter.com/ghrd
Christopher Jones
DCSL - Generalizable Crowd Counting via Diverse Context Style Learning

DCSL Generalizable Crowd Counting via Diverse Context Style Learning Requirement

3 Jun 13, 2022
PyTorch implementation of probabilistic deep forecast applied to air quality.

Probabilistic Deep Forecast PyTorch implementation of a paper, titled: Probabilistic Deep Learning to Quantify Uncertainty in Air Quality Forecasting

Abdulmajid Murad 13 Nov 16, 2022
How will electric vehicles affect traffic congestion and energy consumption: an integrated modelling approach

EV-charging-impact This repository contains the code that has been used for the Queue modelling for the paper "How will electric vehicles affect traff

7 Nov 30, 2022
Deep motion transfer

animation-with-keypoint-mask Paper The right most square is the final result. Softmax mask (circles): \ Heatmap mask: \ conda env create -f environmen

9 Nov 01, 2022
Official repository for the paper "Instance-Conditioned GAN"

Official repository for the paper "Instance-Conditioned GAN" by Arantxa Casanova, Marlene Careil, Jakob Verbeek, Michał Drożdżal, Adriana Romero-Soriano.

Facebook Research 510 Dec 30, 2022
Re-implementation of 'Grokking: Generalization beyond overfitting on small algorithmic datasets'

Re-implementation of the paper 'Grokking: Generalization beyond overfitting on small algorithmic datasets' Paper Original paper can be found here Data

Tom Lieberum 38 Aug 09, 2022
PyTorch version implementation of DORN

DORN_PyTorch This is a PyTorch version implementation of DORN Reference H. Fu, M. Gong, C. Wang, K. Batmanghelich and D. Tao: Deep Ordinal Regression

Zilin.Zhang 3 Apr 27, 2022
TensorFlow implementation of Barlow Twins (Barlow Twins: Self-Supervised Learning via Redundancy Reduction)

Barlow-Twins-TF This repository implements Barlow Twins (Barlow Twins: Self-Supervised Learning via Redundancy Reduction) in TensorFlow and demonstrat

Sayak Paul 36 Sep 14, 2022
Neon: an add-on for Lightbulb making it easier to handle component interactions

Neon Neon is an add-on for Lightbulb making it easier to handle component interactions. Installation pip install git+https://github.com/neonjonn/light

Neon Jonn 9 Apr 29, 2022
Unified API to facilitate usage of pre-trained "perceptor" models, a la CLIP

mmc installation git clone https://github.com/dmarx/Multi-Modal-Comparators cd 'Multi-Modal-Comparators' pip install poetry poetry build pip install d

David Marx 37 Nov 25, 2022
Malware Bypass Research using Reinforcement Learning

Malware Bypass Research using Reinforcement Learning

Bobby Filar 76 Dec 26, 2022
Implementation of the GVP-Transformer, which was used in the paper "Learning inverse folding from millions of predicted structures" for de novo protein design alongside Alphafold2

GVP Transformer (wip) Implementation of the GVP-Transformer, which was used in the paper Learning inverse folding from millions of predicted structure

Phil Wang 19 May 06, 2022
An implementation of DeepMind's Relational Recurrent Neural Networks in PyTorch.

relational-rnn-pytorch An implementation of DeepMind's Relational Recurrent Neural Networks (Santoro et al. 2018) in PyTorch. Relational Memory Core (

Sang-gil Lee 241 Nov 18, 2022
A Python package to process & model ChEMBL data.

insilico: A Python package to process & model ChEMBL data. ChEMBL is a manually curated chemical database of bioactive molecules with drug-like proper

Steven Newton 0 Dec 09, 2021
Code base for the paper "Scalable One-Pass Optimisation of High-Dimensional Weight-Update Hyperparameters by Implicit Differentiation"

This repository contains code for the paper Scalable One-Pass Optimisation of High-Dimensional Weight-Update Hyperparameters by Implicit Differentiati

8 Aug 28, 2022
The code for our NeurIPS 2021 paper "Kernelized Heterogeneous Risk Minimization".

Kernelized-HRM Jiashuo Liu, Zheyuan Hu The code for our NeurIPS 2021 paper "Kernelized Heterogeneous Risk Minimization"[1]. This repo contains the cod

Liu Jiashuo 8 Nov 20, 2022
SIEM Logstash parsing for more than hundred technologies

LogIndexer Pipeline Logstash Parsing Configurations for Elastisearch SIEM and OpenDistro for Elasticsearch SIEM Why this project exists The overhead o

146 Dec 29, 2022
The DL Streamer Pipeline Zoo is a catalog of optimized media and media analytics pipelines.

The DL Streamer Pipeline Zoo is a catalog of optimized media and media analytics pipelines. It includes tools for downloading pipelines and their dependencies and tools for measuring their performace

8 Dec 04, 2022
a project for 3D multi-object tracking

a project for 3D multi-object tracking

155 Jan 04, 2023