echoss AI Bigdata Solution - Query Package
Project description
echoss_query
사용 전 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.query import echoss_query
from echoss_query.dsl import query_dsl
mysql = echoss_query.MysqlQuery('CONFIG_FILE_PATH' or dict)
mongo = echoss_query.MongoQuery('CONFIG_FILE_PATH' or dict)
elastic = query_dsl.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')
mongo.select('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
elastic.get(id='ID')
elastic.search(field='FIELD_NAME',value='VALUE')
elastic.get_source(id='ID') #-> Extract Source
mysql.faster_select('QUERY_STRING') #-> Use SSCursor
mysql.select_list('QUERY_STRING') #-> list
#INSERT
mysql.insert('QUERY_STRING')
mongo.insert('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
elastic.create(id='ID', body='JSON_BODY')
#UPDATE
mysql.update('QUERY_STRING')
mongo.update('COLLECTION_NAME','QUERY_STRING or DICTIONARY')
elastic.update(id='ID', body='JSON_BODY')
#DELETE
mysql.delete('QUERY_STRING')
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.
"""
Project details
Release history Release notifications | RSS feed
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.0.4.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for echoss_query-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e170ebb0a90ef8077beed8eba6e06a06375163b99c8f8afbc6affe26cc522de |
|
MD5 | 92b63a3217a602e440e64fe8ef48c568 |
|
BLAKE2b-256 | acbab284b4ac41fd0f387b205985182ab3abf434fda5fd3d3df9e4fd6bda8bc3 |