Documentation | butterdb on PyPi
butterdb is a library to help you work with Google Spreadsheet data. It lets you model your data as Python objects, to be easily manipulated or created.
import butterdb database = butterdb.Database("MyDatabaseSheet", "[email protected]", "password") @butterdb.register(database) class User(butterdb.Model): def __init__(self, name, password): self.name = self.field(name) self.password = self.field(password) users = User.get_instances() marianne = users[1] print(marianne.password) # rainbow_trout marianne.password = "hunter2" marianne.commit()
bob = User("bob", "BestPassword!") bob.commit()
pip install butterdb
Yep! butterdb is a simple interface around gspread. Just .commit() your objects when you want to update the spreadsheet!
nosetests
- Store data in Google Spreadsheets (the cloud!!!)
- Models from classes
- Fields as attributes. decimals, ints and strings only (as far as I know)
- Commits
- Mocked unit tests, mock database
- Arbitrary cell execution with =blah() (free stored procedures?)
- Auto backup/bad patch control
- Spreadsheets must exist before connecting
- References
- Collections
- Customizable fields
- Customizable table size (arbitrarily hardcoded)
Comments, concerns, issues and pull requests welcomed. Reddit /u/Widdershiny or email me at [email protected].
MIT License. See LICENSE file for full text.