How do you write to a CSV file in bubbles? ImportError: cannot import name get_object

58 views
Skip to first unread message

Peder Jakobsen

unread,
Nov 1, 2013, 1:02:16 PM11/1/13
to datab...@googlegroups.com
The example in the documentation does not work:



from bubbles import default_context as c
from bubbles import get_object

source = get_object("csv", "data.csv")
duplicates = c.o.duplicates(source)


>>>import bubbles
>>> from bubbles import get_object
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name get_object
>>>

Adrian Klaver

unread,
Nov 1, 2013, 1:37:33 PM11/1/13
to datab...@googlegroups.com
Seems imports where changed between 0.1 and 0.2.
get_object is a method of data store and can accessed off them:

In [9]: bubbles.backends.text.CSVStore.get_object?

Type: function
String Form:<function CSVStore.get_object at 0xb5a4ff5c>
File:
/home/aklaver/py_virt/py33/lib/python3.3/site-packages/bubbles-0.2-py3.3.egg/bubbles/backends/text/objects.py
Definition: bubbles.backends.text.CSVStore.get_object(self, name)
Docstring:
Returns a CSVSource object with filename constructed from store's
path and extension

>
> --
> You received this message because you are subscribed to the Google
> Groups "databrewery" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to databrewery...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.


--
Adrian Klaver
adrian...@gmail.com
Reply all
Reply to author
Forward
0 new messages