本文整理汇总了Python中table_fu.TableFu.from_url方法的典型用法代码示例。如果您正苦于以下问题:Python TableFu.from_url方法的具体用法?Python TableFu.from_url怎么用?Python TableFu.from_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table_fu.TableFu
的用法示例。
在下文中一共展示了TableFu.from_url方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_from_url
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_url [as 别名]
def test_from_url(self):
if not os.getenv('TEST_REMOTE'):
return True
url = "http://spreadsheets.google.com/pub?key=thJa_BvqQuNdaFfFJMMII0Q&output=csv"
t1 = TableFu.from_url(url)
t2 = TableFu(urllib2.urlopen(url))
self.assertEqual(t1.table, t2.table)
示例2: data
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_url [as 别名]
def data(self):
"""Return a TableFu instance with data for this model"""
if hasattr(self, '_data') and self._data is not None:
return self._data
if self.file:
# this gets wrapped in a with block for cleanliness
d = TableFu.from_file(self.file.path)
elif self.url:
d = TableFu.from_url(self.url)
else:
return None
if self.columns:
d.columns = self.columns
self._data = d
return self._data
示例3: test_from_url
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_url [as 别名]
def test_from_url(self):
url = "http://spreadsheets.google.com/pub?key=thJa_BvqQuNdaFfFJMMII0Q&output=csv"
t1 = TableFu.from_url(url)
t2 = TableFu(urllib2.urlopen(url))
self.assertEqual(t1.table, t2.table)
示例4: test_from_url
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_url [as 别名]
def test_from_url(self):
murders = TableFu.from_url(self.url)
tabled = Table(title="DC Homicides 2010", added_by=self.user, url=self.url)
tabled.save()
self.assertEqual(murders.table, tabled.data.table)