项目作者: devendrapratap02

项目描述 :
Object Data Model for Google Sheets
高级语言: Python
项目地址: git://github.com/devendrapratap02/g-odm.git
创建时间: 2021-08-15T04:10:54Z
项目社区:https://github.com/devendrapratap02/g-odm

开源协议:

下载


g-odm

Object Data Model for Google Sheets.\
It can be very tedious to read data from various sheets and requires similar kind of code for every sheet.

Example

  1. from godm import LoadPolicy
  2. from godm.field import BooleanField, DateField, IntegerField, StringField
  3. from godm.model import GModel
  4. class Users(GModel):
  5. name = StringField(name="Name")
  6. age = IntegerField(name="Age")
  7. dob = DateField(name="DOB", format=DateField.MM_DD_YYYY, allow_empty=True, default_val="01/01/2010")
  8. is_family = BooleanField(name="Family")
  9. class Meta:
  10. sheet_name = "Test Sheet - GODM"
  11. tab_name = "Users"
  12. header_index = 1
  13. load_policy = LoadPolicy.LAZY
  14. a = Users.manager.filter(is_family=True)
  15. b = Users.manager.filter(age__lt=30)
  16. c = Users.manager.get(name="Devendra")

Installation

As of now, godm is not published to PIP yet. So we have to install it from github itself.

  1. pip install git+https://github.com/devendrapratap02/g-odm.git