@@ -29,17 +29,19 @@ list(catalog)
29
29
This will produce output like
30
30
31
31
```
32
- [table1, table2, table3 ]
32
+ ['first-db.table_a', 'first-db.table_b', 'questions.3' ]
33
33
```
34
34
35
35
To load a table as a Pandas DataFrame
36
36
37
37
```
38
- df = catalog. <table>.read()
38
+ df = catalog[' <table>'] .read()
39
39
```
40
40
41
41
Replace ` <table> ` with the name of the table from the list.
42
42
43
+ This driver supports multiple databases and saved questions.
44
+
43
45
## Load a single table
44
46
To load a table as a Pandas DataFrames you will need to know the following information
45
47
@@ -66,12 +68,40 @@ ds = intake.open_metabase_table(domain, username, password,
66
68
database, table)
67
69
df = ds.read()
68
70
```
71
+ ## Load a single question
72
+
73
+ To load a table as a Pandas DataFrames you will need to know the following information
74
+
75
+ * ` domain ` : The URL where Metabase is running
76
+ * ` username ` : Your username, typically an email address
77
+ * ` password ` : Your password (Google Auth is not yet supported)
78
+ * ` question ` : The numeric id of the question
79
+
80
+ You can generally determine the numeric id of the question you are interested in by
81
+
82
+ 1 . Visit ` <domain>/collection/root?type=card `
83
+ 1 . Click on the question
84
+ * You'll see in the url the question id ` <domain>/question/<question_id> `
85
+
86
+ ``` python
87
+ import intake
88
+ ds = intake.open_metabase_question(domain, username, password,
89
+ question)
90
+ df = ds.read()
91
+ ```
92
+
69
93
70
94
## Constructing catalogs
95
+ This repository provides three drivers
96
+
97
+ * ` metabase_catalog ` : Catalog entry to retrieve all tables and questions
98
+ * ` metabase_table ` : Catalog entry for a single table in a database
99
+ * ` metabase_question ` : Catalog entry for a single saved question
71
100
72
101
To build a catalog containing a Metabase table it can be useful to use the
73
102
[ Catalog Templating] ( https://intake.readthedocs.io/en/latest/catalog.html#templating ) features
74
- to avoid writing usernames and passwords into the catalog
103
+ to avoid writing usernames and passwords into the catalog. For example this catalog
104
+ provides a single table.
75
105
76
106
``` yaml
77
107
metadata :
0 commit comments