Package: gs-sql
gs-sqlgs-sql-
this module is a Python client library for the GoogleSheetAPI data project management platform using SQLInstallationInstall the current version with PyPI:pipinstallgs-sqlOr from Github:https://github.com/EvgeniBondarev/gs-sql/archive/refs/heads/main.zipUsageAt the first login, a browser window will open for confirmation, and a token.pickle file will be created in the directory where your credentials.json file is located to interact with the API.fromgs_sql.sheetsqlimportSheetsQLgs=SheetsQL()gs.authorization("files//credentials.json")Afterwards, you can create a table/database in Google Sheets either using standard methods or through SQL queries.fromgs_sql.dataclassesimportGsDataBasenew_base=gs.execute("""CREATE DATABASE NewBase""")gs.connect(new_base)# or gs.connect(GsDataBase(id="1fB_1uqU8FklXAQdn9XG4QK3HG4l5U0_vvM3abQ3aiuE", name="NewBase"))Finally, you can now create your first table.query=gs.execute("CREATE TABLE Users (id, name)")Final code.fromgs_sql.sheetsqlimportSheetsQLgs=SheetsQL()gs.authorization("files//credentials.json")new_base=gs.execute("""CREATE DATABASE NewBase""")gs.connect(new_base)query=gs.execute("CREATE TABLE Users (id, name)")print(query)Available types of sql queriesDDLNo.CommandDescription1CREATECreates a new table, view, or other object in the database2ALTERModifies an existing object in the database, such as a table3DROPDeletes an existing table, view, or other object in the databaseDMLNCommandDescription1SELECTExtracts records from one or more tables2INSERTCreates records3UPDATEModifies records4DELETEDeletes recordsExamplesCREATE DATABASEgs=SheetsQL()gs.authorization("files//credentials.json")new_base=gs.execute("""CREATE DATABASE NewBase""")sql.connect(new_base)CREATE TABLEquery=gs.execute("CREATE TABLE Users (id, name)")query=gs.execute("CREATE TABLE IF NOT EXISTS Users (id, name)")ALTER TABLEquery=gs.execute("ALTER TABLE Users DROP COLUMN id;")query=gs.execute("ALTER TABLE Users RENAME COLUMN name TO userName;")query=gs.execute("ALTER TABLE Users ALTER COLUMN NewId, NewName;")DROP TABLEquery=gs.execute("DROP TABLE Users;")SELECTquery=gs.execute("SELECT * FROM tableName;")query=gs.execute("SELECT col1, col2, ...colN FROM tableName;")query=gs.execute("SELECT DISTINCT col1, col2, ...colN FROM tableName;")query=gs.execute("""SELECT col1, col2, ...colNFROM tableNameWHERE condition;""")query=gs.execute("""SELECT col1, col2, ...colNFROM tableNameWHERE condition1 AND|OR condition2;""")query=gs.execute("""SELECT col2, col2, ...colNFROM tableNameWHERE colName IN (val1, val2, ...valN);""")query=gs.execute("""SELECT col1, col2, ...colNFROM tableNameWHERE colName BETWEEN val1 AND val2;""")query=gs.execute("""SELECT col1, col2, ...colNFROM tableNameWHERE colName LIKE pattern;""")query=gs.execute("""SELECT col1, col2, ...colNFROM tableNameWHERE conditionORDER BY colName;""")query=gs.execute("""SELECT SUM(colName)FROM tableNameWHERE conditionGROUP BY colName;""")query=gs.execute("""SELECT COUNT(colName)FROM tableNameWHERE condition;""")INNER JOINquery=gs.execute("""SELECT Orders.order_id, Orders.order_date, Customers.     customer_nameFROM OrdersINNER JOIN Customers ON Orders.customer_id = customer_id""")INSERT INTOquery=gs.execute("""INSERT INTO table_nameVALUES (value1, value2, value3, ...);""")UPDATEquery=gs.execute("""UPDATE table_nameSET column1 = value1, column2 = value2, ...WHERE condition;""")DELETEquery=gs.execute("""DELETE FROM table_name WHERE condition;""")Configurationfromgs_api.sheetsqlimportSheetsQLfromgs_api.dataclassesimportResponseTypegs=SheetsQL()gs.authorization("files//credentials.json")sql.set_configuration(colum_color=[(0.85,0.85,0.85)],# Color in RGB formatresponse_type=ResponseType.List)# Standard List or Pandas DataFrame```s