本文整理汇总了Python中table_fu.TableFu.from_file方法的典型用法代码示例。如果您正苦于以下问题:Python TableFu.from_file方法的具体用法?Python TableFu.from_file怎么用?Python TableFu.from_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类table_fu.TableFu
的用法示例。
在下文中一共展示了TableFu.from_file方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: csvviresult
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def csvviresult():
global table
# data = request.form['text']
# table = TableFu.from_file('app/vi-csv.csv')
table = TableFu.from_file('app/vi-csv.csv')
# return render_template('vi-template.html', table=table)
return render_template('vi-template.html', table=table)
示例2: test_set_columns
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def test_set_columns(self):
arra = TableFu.from_file(self.filename)
arra.columns = ["State", "County", "Urban Area"]
tabled = Table(
title="That Stimulus", added_by=self.user, file=File(self.file), columns=["State", "County", "Urban Area"]
)
tabled.save()
self.assertEqual(arra.columns, tabled.data.columns)
示例3: virtualissueautomate
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def virtualissueautomate():
myDOIs = str(request.form["text"]).split('\r\n')
# run python process
createVI(myDOIs)
global table
# data = request.form['text']
table = TableFu.from_file('vi-csv.csv')
return render_template('vi-template.html', table=table, results=results)
示例4: podcastupload
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def podcastupload():
if request.method == 'POST':
# Get the name of uploaded file
file = request.files['file']
# Check if the file is an allowed extension
if file and allowed_file(file.filename):
# Make the filename safe - remove unsupported characters
filename = secure_filename(file.filename)
# # Move the file from the temp folder to the upload folder
file.save(os.path.join(app.config["UPLOAD_FOLDER"], filename))
# Use tablefu to template out the uploaded CSV file
global table
table = TableFu.from_file('app/static/uploads/' + filename)
return render_template('podcastresults.html', table=table)
示例5: facet
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def facet(starter, *facets):
table = TableFu.from_file(starter)
out_dir = os.path.dirname(starter)
files = []
for f in facets:
try:
tables = table.facet_by(f)
except KeyError:
sys.stderr.write('Bad column name: %s\n' % f)
sys.stderr.write('Available columns: %s\n\n' % ', '.join(table.columns))
continue
for t in tables:
out = open(os.path.join(out_dir, '%s.csv' % t.faceted_on), 'wb')
out.write(t.csv().getvalue())
out.close()
files.append(out.name)
return files
示例6: data
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [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
示例7: podcastresult
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def podcastresult():
global table
table = TableFu.from_file('app/chembio.csv')
return render_template('podcastresultsnano.html', table=table)
示例8: test_from_file
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def test_from_file(self):
t1 = TableFu.from_file('tests/arra.csv')
t2 = TableFu(open('tests/arra.csv'))
self.assertEqual(t1.table, t2.table)
示例9: test_from_file
# 需要导入模块: from table_fu import TableFu [as 别名]
# 或者: from table_fu.TableFu import from_file [as 别名]
def test_from_file(self):
arra = TableFu.from_file(self.filename)
tabled = Table(title="That Stimulus", added_by=self.user, file=File(self.file))
tabled.save()
self.assertEqual(arra.table, tabled.data.table)