Skip to main content

Oracle instant client binaries to be used together with cx_Oracle.

Project description

PyOracleClient

CircleCI version PyPI Latest Release License Downloads Buy Me A Coffee

About

This package provides access to Oracle Instant Client's binaries, necessary to connect to Oracle databases with cx_Oracle.

Installation

You can install with pip as:

pip install pyoracleclient

Example

After installation you want to download the oracle instant client: you can do this via the following:

import pyoracleclient as pyoc

pyoc.get_client(version='19.3.0.0.0', sys='linux', url=None)

By default version 19.3 for linux 64bits is downloaded. To obtain a client for a different system provide the corresponding url instead. Visit 'https://www.oracle.com/database/technologies/instant-client/downloads.html', choose your version, and copy the download link. For example for version 19.3.0.0.0 linux 64b, this will be in the form: https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip.

You can now add tns names via the pyoracleclient.add_tns function as shown below.

import pyoracleclient as pyoc

pyoc._delete_all_tns()

pyoc.add_tns(name='FSSDB', service_name='servicename.prd.tns',
             protocol1='TCP', host1='host1address', port1=1000,
             protocol2='TCP', host2='host1address', port2=1000)

Alternatively you can append your own tns specification as a string as follows:

import pyoracleclient as pyoc

pyoc.add_custom_tns("""yourtnsname = (DESCRIPTION=
                    (ADDRESS_LIST=(FAILOVER=ON)
                                  (LOAD_BALANCE = OFF)
                                  (ADDRESS=(PROTOCOL=TCP)
                                           (HOST=host1address)
                                           (PORT=1000))
                                  (ADDRESS=(PROTOCOL=TCP)
                                           (HOST=host1address)
                                           (PORT=1000)))
                                  (CONNECT_DATA=(SERVER=dedicated)
                                  (SERVICE_NAME=servicename.prd.tns)))
                    """)

Finally, you can also fill the tnsnames.ora file manually. Its location can be found in the variable pyoracleclient._TNSORA_PATH.

Author

Luca Mingarelli, 2020

You find this work useful? Buy Me A Coffee

Python

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyOracleClient-0.2.6.tar.gz (111.1 kB view details)

Uploaded Source

Built Distribution

PyOracleClient-0.2.6-py3-none-any.whl (110.8 kB view details)

Uploaded Python 3

File details

Details for the file PyOracleClient-0.2.6.tar.gz.

File metadata

  • Download URL: PyOracleClient-0.2.6.tar.gz
  • Upload date:
  • Size: 111.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for PyOracleClient-0.2.6.tar.gz
Algorithm Hash digest
SHA256 b70e10ff15f043519cd1763629981bc6f538d0ce5fd88aa82072ca1c474933b3
MD5 208b550f723267a00eec032f31603dab
BLAKE2b-256 dacd53043a2f6184a5f0d2a562a4f74edefd59a3314434cebaab0907b11e2e24

See more details on using hashes here.

File details

Details for the file PyOracleClient-0.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for PyOracleClient-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3061344abd887511bbf757148ce83d2d0723b554a0b340d99d4713df4c5550ce
MD5 f72d9c6d4e8b00c6cc0e8d9174a8af10
BLAKE2b-256 779e17702946596718caa50174dd872e60e24dd068f899b16cf662ec676b5a04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page