Skip to main content

A simple etl tool.

Project description

README

A simple etl tool.

Introduction

Install

pip install water-pipe

Sample code

from water_pipe.channel import DataChannel

if __name__=='__main__':
    impala_db_config = {
        "driver": "impala",
        "config": {
            "host": "10.63.82.218",
            "username": "work",
            "password": "TwkdFNAdS1nIikzk",
            "database": "default",
            "port": 21050,
            "auth_mechanism": "LDAP",
        }
    }
    pg_db_config = {
        "driver": "postgres",
        "config": {
            "host": "10.63.82.191",
            "username": "dw_rw",
            "password": "Yxsj@123",
            "database": "test",
            "port": 5432
        }
    }
    csv_db_config = {
        "driver": "csv",
        "config": {
            "filename": "data",
            # "path": ""
        }
    }

    with DataChannel(impala_db_config, pg_db_config) as channel:
        channel.table("tmp.t2")
        # channel.sink_db.execute("truncate table medical.t2")
        channel.insert("medical.t2", 2, is_create=True)
    
    with DataChannel(pg_db_config, impala_db_config) as channel:
        channel.query("select * from medical.t2 limit 9")
        channel.insert("tmp.t3", 2, is_create=True)
    
    with DataChannel(pg_db_config, csv_db_config) as channel: 
        channel.query("select * from medical.dim_date limit 123")
        channel.insert(is_create=True)
        
    with DataChannel(csv_db_config, pg_db_config) as channel: 
        channel.query()
        channel.insert("medical.t_csv", 2, is_create=True)
        

Dependency

pip install loguru

pip install impyla
pip install psycopg2
pip install mysqlclient
pip install openpyxl

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

water-pipe-0.0.3.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

water_pipe-0.0.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file water-pipe-0.0.3.tar.gz.

File metadata

  • Download URL: water-pipe-0.0.3.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for water-pipe-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c91fc7ebf1f879edf6922f70803863258c909c4bea16df4f642d88d16ee2b24b
MD5 eb7edc01d0bd94f6225f085bfbb9c8b9
BLAKE2b-256 a7db9f43ad7842219de778ffd46f097cf8407c88e5fa9d8512a5f591169d0d59

See more details on using hashes here.

File details

Details for the file water_pipe-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: water_pipe-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for water_pipe-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a2acf884f6dd708e909a06875325a93fbb8dd44aa529f53f776d404739b17e36
MD5 474f2054f6114d6a2f85280e2e4ef31a
BLAKE2b-256 5d5c75b25b4a07febfc2b370ba28ca6c7f92187beac9f290e0345b2a5fadcb3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page