{ "info": { "author": "Robert Ranney", "author_email": "robertpranney@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Topic :: Database :: Front-Ends" ], "description": "# EPL Toolset\n\nEPL stands for extract-pandas-load. A package to make oracle-python ETL script development easier. Working with cx_oracle and pandas can be overly cumbersome when only simple functionals are needed. This package try to make this interactions with need less boilerplate code. Meant to work with python 3.6\n\n### Installation\nepltoolset is avaialbe on pypi and can easier installed with use of pip.\n```shell\npip install epltoolset\n```\n\n### Creating Credential Files\nThe package provides a simple to use script to generate credential files. These credentials are then stored in a json format.\n```shell\nmanage-oracle-creds\n```\nThe format for the credential files is a follows if instead you want to edit them directly.\n```json\n{\n \"\": {\n \"HOST\": \"\",\n \"PORT\": ,\n \"SID\": \"\",\n \"USERNAME\": \"\",\n \"PASSWORD\": \"\",\n },\n \"\":{\n ...\n }\n ...\n}\n```\n\n### Importing for Use\nThe main class is the PdConnection Class. There is also a credentials class that is utilized by PdConnection class, but it is not needed to be imported unless finer control is needed.\n```python\nfrom epltoolset import Credentials, PdConnection\n```\n\n## Using the PdConnection class\n\n#### Instantiating object\nConnection object can be created and then viability of object can be checked through methods\n```python\n# Instantiate a connection object\ncn = PdConnection(cred_set=\"TEST_SPOT\", cred_file='.connectcreds.creds')\n\n# Check everything is in order\nif cn.cred_file_exists():\n print(\"Specified Credential File Exists\")\nif cn.cred_set_exists():\n print(\"Specified Credential File Exists\")\ncn.load_cred_set()\nif cn.can_connect():\n print(\"Tested that connection Possible\")\n```\n\n```shell\nSpecified Credential File Exists\nSpecified Credential File Exists\nTested that connection Possible\n```\n\nChaining of methods can also be used to instantiate and load credentials, or chain many other methods together.\n\n```python\ncn = PdConnection(cred_set=\"TEST_SPOT\").load_cred_set()\n```\n\n#### Querying oracle table in to a dataframe\nIt is possible to take a sql query directly to a pandas dataframe without worrying about the cx_oralce connection that is needed to make this possible.\n```python\ndf = cn.sql_to_dataframe(sql=\"SELECT * FROM example_table_rr\")\nprint(df.head())\n```\n\n```shell\nFAVORITE_PASTRY MEMBERDATE PERSONID SCORE\n0 muffin 23-NOV-15 1 3.2\n1 scone 13-SEP-12 2 2.3\n2 bagel 03-FEB-16 3 1.2\n3 donut 01-DEC-05 4 0.4\n4 cookies 05-NOV-17 5 4.0\n```\n\n#### Placing a dataframe into an oracle table\nAfter doing any operations that are needed then same connection object can be used to then place the dataframe back into the database. If the table already exists then the table create will fail, unless it is specified to drop it.\n\n```python\ncn.df_to_table(df, \"example_table_post_trans_rr\", drop_existing=True)\n```\n\n#### Some other stuff\nGeneric sql can be executed as well\n```python\ncn.execute_sql(some_sql_string)\n```\nOther functions can be used for finer control of the connection, although not necessary since connections will be closed and opened if needed by the individuals methods.\n```python\ncn.make_connection()\ncn.close_connection()\ncn.is_connected()\n```\nAttributes of the connection object can be accessed directly if needed to change the function. Some of these can also be set at instantiation, or can be left to default values.\n```python\ncn.cred_set # To maybe change the database or schema with same file\ncn.fetch_size # integer that can affect querying performance\nself.creds # epltoolset.Credentials, loaded by method\nself.conn # cx_Oracle.Connection, can be kept open between uses\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com.robertpranney/epltoolset", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "epltoolset", "package_url": "https://pypi.org/project/epltoolset/", "platform": "", "project_url": "https://pypi.org/project/epltoolset/", "project_urls": { "Homepage": "http://github.com.robertpranney/epltoolset" }, "release_url": "https://pypi.org/project/epltoolset/0.3.2/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Simplify Oracle ETL scripts", "version": "0.3.2" }, "last_serial": 4341133, "releases": { "0.2.9": [ { "comment_text": "", "digests": { "md5": "b88642821b4c0ed66412382134cf2100", "sha256": "d5d4e37bd34b34b8779cdbac0c2db402d4a05d772e542cd48355e831ca1ef873" }, "downloads": -1, "filename": "epltoolset-0.2.9.tar.gz", "has_sig": false, "md5_digest": "b88642821b4c0ed66412382134cf2100", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6863, "upload_time": "2018-08-06T15:54:17", "url": "https://files.pythonhosted.org/packages/1a/cd/f0df488e3dc42e3d64202b7c94fcb80a6b970a81c156fa335a2389b8c69b/epltoolset-0.2.9.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "4cbded82587a19c42d01ec894d843ad4", "sha256": "73d7de228d35353301e3851959b485ee32243e94bf23cd3a63accc32a1ebc533" }, "downloads": -1, "filename": "epltoolset-0.3.0.tar.gz", "has_sig": false, "md5_digest": "4cbded82587a19c42d01ec894d843ad4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9775, "upload_time": "2018-08-13T04:40:11", "url": "https://files.pythonhosted.org/packages/cc/fc/19944079f204c9e159a9eb233f81153453f47588ea1213ee72fc2ebdd1a9/epltoolset-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "d87ed05455b36f3c8c0b9d9a0cbdd55d", "sha256": "6584a230bf8e9e57d5596af9d67b5ed3cd5f05dde07ed0b1bc7d2a10a5288ce5" }, "downloads": -1, "filename": "epltoolset-0.3.1.tar.gz", "has_sig": false, "md5_digest": "d87ed05455b36f3c8c0b9d9a0cbdd55d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9820, "upload_time": "2018-08-23T19:57:01", "url": "https://files.pythonhosted.org/packages/55/c2/46ab322401e344119791bcb21d10dd4ad1c3f37cd7b6fbd5a6e9c4c09a70/epltoolset-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "de3f2369d9b68f08270d077d5aa41aaf", "sha256": "79270821a2cabae8857f92ed137e5b827cf1e2b02ce0860304aa4cc0ed46adce" }, "downloads": -1, "filename": "epltoolset-0.3.2.tar.gz", "has_sig": false, "md5_digest": "de3f2369d9b68f08270d077d5aa41aaf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9810, "upload_time": "2018-10-04T17:02:15", "url": "https://files.pythonhosted.org/packages/22/fd/c6c18106bf16d7b8935536f1ca825d909d1bdba908f576d730837a729cbc/epltoolset-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de3f2369d9b68f08270d077d5aa41aaf", "sha256": "79270821a2cabae8857f92ed137e5b827cf1e2b02ce0860304aa4cc0ed46adce" }, "downloads": -1, "filename": "epltoolset-0.3.2.tar.gz", "has_sig": false, "md5_digest": "de3f2369d9b68f08270d077d5aa41aaf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9810, "upload_time": "2018-10-04T17:02:15", "url": "https://files.pythonhosted.org/packages/22/fd/c6c18106bf16d7b8935536f1ca825d909d1bdba908f576d730837a729cbc/epltoolset-0.3.2.tar.gz" } ] }