This library is distributed under the MIT license. compile (), using = metabase ) Endpointsįor a full list of endpoints and methods, see Metabase API. create ( name = "Gmail Users", description = "Number of users with a email address.", table_id = 2, definition = Query ( table_id = 1, aggregations =, filters = ). from metabase import Metric, Query, Count, EndsWith, CaseOption metric = Metric. This can also be used to more easily create Metric objects. create ( database = 1, type = "query", query = from metabase import Dataset, Query, Count, GroupBy, TemporalOption dataset = Dataset. Metabase Query Language) from Python classes included in this package. You can also execute queries and get results back as a Pandas DataFrame. id, using = metabase, ) Querying & MBQL list (): # add all users to my_group PermissionMembership. create ( name = "My Group", using = metabase ) for user in User. Here's a slightly more advanced example: from metabase import User, PermissionGroup, PermissionMembership # create a new PermissionGroup my_group = PermissionGroup. ![]() send_invite () # Resend the user invite email for a given user. Some endpoints also support additional methods: from metabase import User user = User. delete() are available on allĮndpoints that support them in Metabase API. create ( using = metabase, first_name = "", last_name = "", email = "", password = "" ) delete () # create an object new_user = User. update ( is_superuser = True ) # delete an object user. is_active : print ( "User is active!" ) # update any available attribute user. get ( 1, using = metabase ) # attributes are automatically loaded and available in the instance if user. list ( using = metabase ) # get an object by ID user = User. from metabase import User # get all objects users = User. regular tables Your typical, basic table is a grid of cells. All changes are reflected in Metabase instantly. Unsupported databases when creating pivot tables in Metabase Pivot tables are currently unavailable for the following databases in Metabase: Druid Google Analytics MongoDB Pivot tables work for all other officially supported databases. ![]() Instantiate an object from the Metabase API require the using parameter which expects an instance of Metabase suchĪs the one we just instantiated above. ![]() You can then interact with any of the supported endpoints through the classes included in this package. from metabase import Metabase metabase = Metabase ( host = "", user = "", password = "", ) Interacting with Endpoints Start by creating an instance of Metabase with your credentials. An unofficial Python library for the Metabase API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |