Skip to main content

Tools for working with an Oracle database from Pandas

Project description

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 oracle_db_tools

Overview

Sample usage:

from pandas_oracle.tools import query_to_df

query = "select id, name from students where name like '%Oscar%'"
query_to_df(query, "config.yml")

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"
    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.

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

pandas_oracle-1.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

pandas_oracle-1.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pandas_oracle-1.1.1.tar.gz.

File metadata

File hashes

Hashes for pandas_oracle-1.1.1.tar.gz
Algorithm Hash digest
SHA256 c0ce58f060f291020a9a8f2a795f358a434cf80f7e0fb6437bcef6ce87edeffe
MD5 92a9443cd3a40f0348a787d28637434f
BLAKE2b-256 6dbfe2c06d6477b2def48aeca90d91fffa7f00cd87216b2f23ce9968a109fcb6

See more details on using hashes here.

File details

Details for the file pandas_oracle-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_oracle-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6eae32ac9aa4531f6d92b54fc34287318c33414df9fc4029fd4d0c888d60b693
MD5 ced427d3fd8de03321cf1e2da5e7b5f2
BLAKE2b-256 af86bd7dfce9312864cb2dd3bfb4ec17798e1e77d5fd60f5f82d436e64567ac3

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