oracle_utils: local sqlplus query module
Python module to automate the interaction with sqlplus for database scripting. It is designed to connect to a local database instance as defined by the ORACLE_SID environment variable.
The sqlplus program is called once and run in a subprocess so multiple queries can be quickly run. Performance is much better than Bash with cat <<EOF for integrating database data into scripts. The query results are returned in JSON format.
Example
from oracle_utils import Sqlplus
import json
sql_session = Sqlplus()
sql_session.start()
result = sql_session.run_query('select * from dual;')
print(json.dumps(result, indent=4))
sql_session.end()
You can pass a query to the module if you want to only execute one query and output the results to the terminal:
Sqlplus(query="select * from v$instance;")
This also enables a Bash one-linter to run a quick query:
python -c "from oracle_utils import Sqlplus; Sqlplus(query='select * from v\$instance;')"
Metadata
Release files for oracle_utils 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oracle_utils-1.1.1.tar.gz | 17.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oracle_utils-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.1 kB
Release files / oracle_utils-1.1.1.tar.gz
| Download URL | oracle_utils-1.1.1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41b9a355f5912dead2884fc9287ed3738d9d6a9f56b1d99c7ccc7598d6caeb4d
|
|
BLAKE2b-256 checksum How to use checksums |
4f6f84da1318743d3d3a76ba595e62af78a05c48bd17b9d476dff04aa86e7b73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.16.2 cpython/3.12.10 HTTPX/0.28.1
|
Release files / oracle_utils-1.1.1-py3-none-any.whl
| Download URL | oracle_utils-1.1.1-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
286b128cc3e6567f34eba844283843d2b7f255bdd67bf8290f3e878df26e605e
|
|
BLAKE2b-256 checksum How to use checksums |
044f26573dd615b6f1ee023bae9542882207c3b3d0cfd86cd0c35755f8d32bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.16.2 cpython/3.12.10 HTTPX/0.28.1
|