Using google spreadsheets as database.
- Creating Tables
- Inserting Rows
- Get all records
- Search for One Row
- Search for particular number of Rows
from db_sheet.db_sheet import DbSheet
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
db = DbSheet(db_name = "SHEETBACKEND", api_creds = "client_secret.json", scope = ['https://spreadsheets.google.com/feeds'])
sheet = db.get_db_conn()
Sheet is like database.
from db_sheet.db_sheet import DbSheet
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
db = DbSheet(db_name = "SHEETBACKEND", api_creds = "client_secret.json", scope = ['https://spreadsheets.google.com/feeds'])
sheet = db.get_db_conn()
table = Table({"Col1","col2"},"name_of_table")
creator = CreateTable(table, sheet)
creator.create_table()
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
working_table = WorkingTable("tablename",sheet)
working_table.insert({"value1","value2"}
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
working_table = WorkingTable("tablename",sheet)
working_table.get_all()
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
working_table = WorkingTable("tablename",sheet)
working_table.get_one("column_name",value)
from db_sheet.sheet_table import WorkingTable, CreateTable, Table
working_table = WorkingTable("tablename",sheet)
working_table.find("column_name",value,total_count_u_need)
- Make sure your build is passing
- Keep your code clean and proper commenting with pep8.
Thats it for now. Will add more since its just a begginging. Suggestions are welcome. Please create an issue if you think this is **** and you can make it better :D
@ Author: chowmean