terrible-ideas / butterdb Goto Github PK
View Code? Open in Web Editor NEWbutterdb is a Python object mapper for Google Drive Spreadsheets. Still in development, but usable.
Home Page: https://pypi.python.org/pypi/butterdb
License: MIT License
butterdb is a Python object mapper for Google Drive Spreadsheets. Still in development, but usable.
Home Page: https://pypi.python.org/pypi/butterdb
License: MIT License
I'm planning on rewriting butterdb, and I'd like to start a conversation around usage. I'd love any examples or thoughts around how you'd like to use the library.
Off the top of my head, this is what I had envisaged:
database = butterdb.GoogleSpreadsheets(oauth_key)
@butterdb.register(butterdb.model)
class FooModel(object):
def __init__(self, bar, baz):
self.bar = butterdb.StringField(bar)
self.baz = butterdb.IntField(baz)
FooModel.all()
FooModel.where(bar: 'test')
FooModel.find(baz: 1)
instance = FooModel('blah', 5)
instance.save()
instance.foo = 'snaz'
instance.save()
Is there anything in there you'd change? Are there other object mappers with crazy cool features I should steal?
Please let me know if you want this feature.
Should contain technology, testing and a more detailed explanation
may your api have twisted protocol support since this affect IO calls a non blocking solution would be highly appreciated.
A separate constructor should be added, as this is super redundant.
Hi there,
Thanks for creating this library. Here is a question, i'm trying to run the example code. Reading from the spreadsheet works like a charm. However, trying to commit one cell change is throwing this error.
Error comes from the line: marianne.commit()
Any idea?
Here is the stacktrace:
Traceback (most recent call last):
File "butterdb_hello.py", line 32, in
marianne.commit()
File "/Library/Python/2.7/site-packages/butterdb-0.1.4-py2.7.egg/butterdb/fuckit.py", line 127, in commit
cell = self.database.get_cell(self.data, field.row, field.column)
File "/Library/Python/2.7/site-packages/butterdb-0.1.4-py2.7.egg/butterdb/fuckit.py", line 48, in get_cell
return data.cell(row + 1, column + 1)
TypeError: unsupported operand type(s) for +: 'builtin_function_or_method' and 'int'
Right now all I can do is fetch all rows, iterate and compare. Even if it needs to be implemented this way, this is something i'd expect an ORM to do.
No point in getting people to define models that can easily be generated.
Can be achieved by storing repr of data and using ast.literal_eval to parse.
I'd rather avoid writing the password of my google account in the middle of my poor quality server side app code full of bad practices.
(I workarounded this by creating a google account that only has access to that account, so i'm just requesting the feature now so you keep it in mind for the rewrite.)
gspread docs:
https://github.com/burnash/gspread#alternate-authorization-using-oauth2
Got to change import too.
Hi,
i'm new to this but I have an issue I hope someone can address, sorry if this is a dumb question:
I use the Python gspread library on a Raspberry Pi to log temperature from a sensor and write to a Google Doc spreadsheet.
I can open the spreadsheet from my code fine.
However testing the instruction below:
worksheet.append_row("hello")
will not write "hello" in the first cell of the new row, but instead will write "h" in first cell, "e" in the cell next to it etc... (each letter in a new cell on the same row)
What am I doing wrong?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.