Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature Request -> Uploading csv #6094
Spending some time in metabase, I couldn't find an option to create visualizations based on csv's.
If not, it would be lovely to have this as a feature
referenced this issue
Jan 20, 2018
@aadrian yes this does it. Also, I was wondering what sort of options can this support. I mean, it would be less than the sql query thingy but still I'll expect basic aggregations.
PS: While this may be out of context, but just reminded me of apache spark. It also provides various ways of transforming data fetched from a csv. (Incase, anyone needs ideas)
One fairly easy workaround is to first convert the CSV file to SQLite, and then import it to Metabase as SQLite db.
Code in Python (based on this answer):
import csv, sqlite3 con = sqlite3.connect("C:\\Users\\John\\testdb.db") # first create an empty file to save the db cur = con.cursor() cur.execute("CREATE TABLE t ('Col1' text, 'Col2' text);") with open('C:\\Users\\John\\test.csv','rb') as csvFile: # csv.DictReader uses first line in file for column headings by default dr = csv.DictReader(csvFile) # comma is the default delimiter to_db = [(i['Col1'], i['Col2']) for i in dr] cur.executemany("INSERT INTO t ('Col1','Col2') VALUES (?, ?);", to_db) con.commit() con.close()