Skip to main content

echoss AI Bigdata Solution - Query Package

Project description

echoss_query


MySQL, MongoDB, Opensearch compatible query access package

Prepare

사용 전 config(인증 정보) 의 유무를 확인한 뒤 사용해야한다.

Installaion


To install this package, please use Python 3.8 or higher.

Install from Source:

    git clone https://gitlab.echoss.net/big-data/solution-center/echoss_query
    cd ~/echoss_query
    pip install -r requirements.txt

Quick Start


    from echoss_query import MysqlQuery, MongoQuery, ElasticSearch

    mysql = MysqlQuery('CONFIG_FILE_PATH' or dict)
    mongo = MongoQuery('CONFIG_FILE_PATH' or dict)
    elastic = ElasticSearch('CONFIG_FILE_PATH' or dict)


    #CREATE
    mysql.create('QUERY_STRING')
    elastic.index(index='INDEX_NAME')

    #DROP
    mysql.drop('QUERY_STRING')
    elastic.delete_index(index='INDEX_NAME')

    #TRUNCATE
    mysql.truncate('QUERY_STRING')

    #ALTER
    mysql.alter('QUERY_STRING')

    #SELECT

    mysql.select('QUERY_STRING', params=None) -> dataframe
    mongo.select('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
    elastic.get(id='ID')
    elastic.search_field(field='FIELD_NAME',value='VALUE')
    elastic.get_source(id='ID') #-> Extract Source

    mysql.select_one('QUERY_STRING', params=None) -> dict
    mysql.select_list('QUERY_STRING', params=None) -> list(dict)
    mysql.faster_select('QUERY_STRING', params=None) -> dataframe

    #INSERT

    mysql.insert('QUERY_STRING', params=None)
    mongo.insert('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
    elastic.create(id='ID', body='JSON_BODY')

    #UPDATE

    mysql.update('QUERY_STRING', params=None)
    mongo.update('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
    elastic.update(id='ID', body='JSON_BODY')

    #DELETE

    mysql.delete('QUERY_STRING', params=None)
    mongo.delete('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
    elastic.delete(id='ID')

    #Check Database

    mysql.databases()
    mongo.databases()

    #Check Tables
    mysql.tables('DB_NAME')

    #-MySQL Util Function-

    # Ping
    mysql.ping()
    elastic.ping()

    # Connection Information
    mysql.conn_info()
    elastic.info()

    # Close
    # crash process close
    mysql.close()

Code Quality

When creating new functions, please follow the Google style Python docstrings. See example below:

def example_function(param1: int, param2: str) -> bool:
    """Example function that does something.

    Args:
        param1: The first parameter.
        param2: The second parameter.

    Returns:
        The return value. True for success, False otherwise.

    """

Version history

v1.0 initial version v1.1 echoss_logger include v1.2 mysql support query with params. return cursor.rowcount for insert/update/delete query

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

echoss_query-0.1.7.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

echoss_query-0.1.7-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file echoss_query-0.1.7.tar.gz.

File metadata

  • Download URL: echoss_query-0.1.7.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for echoss_query-0.1.7.tar.gz
Algorithm Hash digest
SHA256 c13d7a793ae22c634e96260239b22f8d258c0a9d801b2b28fc141a119661d4fa
MD5 82f00d931b1584cc480a0a8a08e3f7e0
BLAKE2b-256 d4003f789aa62e0a35dfe4e776ff68bc3fe08cd367a8c0f0ffd91a1dacd5ddef

See more details on using hashes here.

File details

Details for the file echoss_query-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for echoss_query-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ac696cda6c914cace1be80db8c533ea4d83a510a665c50208084263bfb6c9980
MD5 62e2e4c07ef19bb8a0f895ea91b0320c
BLAKE2b-256 29899771ab6b75d1424878ee1b34c3775da23e9775be055b905912392fe024ba

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