Package: connectdb
ConnectDBConnect python with Mysql, MongoDB, Cassandra databaseInstallationRun below commandto install this packagepip install connectdbMysqlprerequisitemysql-connector-pythonmust be installed
To install it, run below commandpip install mysql-connector-pythonConnect with Mysql using pythonimportfrom connectdb import mysql_dbconnectob=mysql_db.sql("host","user","password")Check database ListFunction db_list is used to show databases listob.db_listCreate DatabaseFunction create_ db is used to create a new databaseParameters
    ----------
    db_name: database nameob.create_db(Data_base_name)Drop DatabaseFunction drop_ db is used to drop a databaseParameters
    ----------
    db_name: database nameob.drop_db(Data_base_name)Create tableFunction create_ table is used to create a new tableParameters
    ----------
    table_name: table name
    columns: columns names with data type and other discription in SQL format
    example-columns="CI_n INT(2),CI_m INT(2),IAC_u VARCHAR(10),IAC_v VARCHAR(10),IAC_w VARCHAR(10),CAC_u VARCHAR(10),CAC_v VARCHAR(10),CAC_w VARCHAR(10)"ob.create_table(table_name,columns)Insert into TableFunction insert is used to insert value in tableParameters
    ----------
    table_name: table name
    data: values to be inserted in orderob.insert(table_name,data)columnsFunction columns is used to print columns namesParameters
    ----------
    t_name: table nameob.columns(t_name)Select DataBaseFunction select_db is used to select a databaseParameters
    ----------
    db_name: database nameob.select_db(db_name)QueryFunction query is used to run a SQL queryParameters
    ----------
    query: SQL queryob.query(query)MongoDBprerequisitepymongo and pandas must be installed
To install pymongo, run below commandpip install pymongoTo install pandas, run below commandpip install pandasConnect with MongoDB using pythonimportfrom connectdb import mongodbconnectob=mongodb.mongo()ob.connect(Connection URL, Database Name)Create CollectionFunction create_ table is used to create a new tableParameters
    ----------
    COLLECTION_NAME: collection nameob.create_collection(COLLECTION_NAME)InsertFunction insert is used to insert value in tableParameters
    ----------
    record: data to be inserted as dict, to insert many data use list of dictob.insert(collection_name,record)UpdateFunction delete is used to delete record from collectionParameters
    ----------
    collection_name: collection name
    where_dict: condition as dict
    new_dict:new valuesob.update(collection_name,new_dict,where_dict)DeleteFunction delete is used to delete record from collectionParameters
    ----------
    collection_name: collection name
    where_dict: condition as dictob.delete(self, collection_name,where_dict)DownloadFunction To download whole collection
Parameters
----------
collection_name: collection nameob.download(collection_name)Cassandraprerequisitecassandra-driver must be installed
To install cassandra-driver, run below commandpip install cassandra-driverConnect with Cassandra using pythonimportfrom connectdb import cassandra_dbconnectob=cassandra_db.cass()ob.connect(Secure Bundle Zip Path,clientID,clientSecret,keyspace)Create TableTo create tableParameters
    ----------
    table:table name
    columns_with_datatype: columns name with datatypes as stringob.create_table(table, columns_with_datatype)InsertTo insert in tableParameters
    ----------
    table:table name
    columns: columns name
    values: valuesob.insert(table, columns, values)SelectTo select row in tableParameters
    ----------
    table:table name
    columns: columns name
    where: where conditionob.select(table, columns, where(optional))UpdateTo update row in tableParameters
    ----------
    table:table name
    columns_with_values: columns name with values eg age=88
    where: where conditionob.update(table, columns_with_values, where)DeleteTo delete row in tableParameters
    ----------
    table:table name
    where: where conditionob.delete(table, where)Execute QueryTo execute any Cassandra queryParameters
    ----------
    query:Cassandra queryob.execute(query)License© 2021 Arjun PanwarThis repository is licensed under the MIT license. See LICENSE for details.