Skip to main content

Pandas Oracle

This package includes methods for:

  1. Running a specified query, passed in as a string, on an Oracle database and returning the result to a Pandas data frame.

  2. Executing a command with no return data.

  3. Inserting the contents of a Pandas data frame into an Oracle database table.


Installation

pip install pandas_oracle

Overview

Sample usage:

import pandas_oracle.tools as pt

query1 = "select id, name from students where name like '%Oscar%'"
query2 = "select class, avg(age) from students group by class"

## opening conn
conn = pt.open_connection("config.yml")

## passing the conn object to the query_to_df
df1 = pt.query_to_df(query, conn, 10000)

## passing the conn object to the query_to_df , without to open again
df2 = pt.query_to_df(query2, conn, 10)

## close connection
pt.close_connection(conn)

Returns:

          ID                NAME
0    3298272         Meyer,Oscar
1    2304928         Wilde,Oscar
2    7654321        Grouch,Oscar
.        ...                 ...
128  2234879    De La Hoya,Oscar
129  9872322      Peterson,Oscar
130  9082394       Sanchez,Oscar

[131 rows x 2 columns]

Sample config file:

database:
    username: "OGROUCH"
    password: "SECR3TPASSWORD"
    sysdba: "n"
    host: >
            (DESCRIPTION =
                    (ADDRESS = (PROTOCOL = TCP)
                               (HOST = servername.myschool.edu)
                               (PORT = 1521)
                    )
                    (CONNECT_DATA = (SERVER = DEDICATED)
                                    (SID = dbname)
                    )
            )

If you don’t wish to store your password in the configuration file, you can omit that line. If a password isn’t present in the configuration file, you will be prompted for it at runtime.

You can choose whether or not to connect with the SYSDBA role. If the yaml file doesn’t include the “sysdba” property, it will connect like a normal user.

As of version 2.1.0, the _cc methods have been added (query_to_df_cc, execute_cc, and insert_multiple_cc). These methods get passed a config file rather than a connection object and take care of opening and closing the connection for you.

Metadata

Release files for pandas-oracle 2.1.4

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

Source distribution (sdist)

Source distribution for pandas-oracle 2.1.4
File Size Uploaded Provenance
pandas_oracle-2.1.4.tar.gz 4.0 kB Without provenance Details

Release files / pandas_oracle-2.1.4.tar.gz

Download URL pandas_oracle-2.1.4.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e9a4e5e8bcf356a695ba2be7c1a2008ca9311e66f0e8694cab812481e5549edc
BLAKE2b-256 checksum
How to use checksums
c11172677740dc1f79cacc4e9bcc7a89cb7df231f0d04296771a5da2496744ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for pandas-oracle 2.1.4

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