Skip to main content

oracle-connection

This package is a new tool to connect Oracle database.

One important thing is that I’m not the first author of this package. At the early time, this package was write by my ex-leader in 2017. And it wasn’t a package, just a python file named my_modules. Then, we modified it last year. At last she left this company, Then I refactored the code, deleted some methods uselsee.

Example

To connect:

from oracle_connection import ConnectOracle
from oracle_connection import DatabaseOperate

conn = ConnectOracle(
    "your host",
    "your instance name",
    "your username",
    "your password"
)
cursor = DatabaseOperate(conn)
# operations
cursor.close_cursor()

Get datas from database:

# ...
sql = """SELECT field1, field2 FROM table"""
# get all rows
rows = cursor.get_all(sql)
# get first row
row = cursor.get_one(sql)
# get all datas and reformat it to a dataframe
df = cursor.get_df(sql)
sql = """SELECT field FROM table"""
# get one column and reformat it to a list
row_list = cursor.one_column_list(sql)
cursor.close_cursor()

The other operations:

# ...
value1, value2, value3 = 1, 2.2, "c"
sql = """INSERT INTO table (field1, field2, field3
         ) VALUES (:value1, :value2, :value3)"""
# insert one row into table
cursor.execute_sql(
    sql, value1=value1, value2=value2, value3=value3
)

sql = """INSERT INTO table (field1, field2, field3
         ) VALUES (:1, :2, :3)"""
data = [
    [1, 2.2, "c"],
    [2, 2.1, "d"],
    [3, 4.2, "f"],
    [4, 6.2, "g"]
]
# insert many rows into table
cursor.insert_data(sql, data=data)

sql = """DELETE FROM table WHERE field=:value"""
# delete datas from table
cursor.execute_sql(sql, value=value1)

Metadata

Release files for oracle-connection 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oracle-connection 0.1.2
File Size Uploaded Provenance Actions
oracle-connection-0.1.2.tar.gz 3.0 kB Without provenance Details for oracle-connection-0.1.2.tar.gz

Release files / oracle-connection-0.1.2.tar.gz

Download URL oracle-connection-0.1.2.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de067fd2ec250ce76d50a5c086a730090ba667d786497bbfd21df5d97bcf69d1
BLAKE2b-256 checksum
How to use checksums
8b1a139360307bf76b712c2f466421868f984951aa70fe961639666be7272199
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for oracle-connection 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page