Show Attributes#
Note
The show_
endpoints are meant to be used by admins to build functionality into their metacatalog deployment. These endpoints are not really helpful for the end-user.
Help#
- metacatalog.api.show_attributes(table_name, add_type=False)#
Returns a list of available attributes on the given table. The table_name has to match the actual table in the database.
- Parameters:
table_name (str) – Name of the table the attributes are requested for.
add_type (bool) – If True, a list of tuples will be returned. The tuple will contain (column_table, colmun_data_type)
- Returns:
attributes – List of attributes available on the requested table.
- Return type:
list
Example#
Note
api.show_attribute
is one of the very few api endpoints that don’t need a session to connect to the database, as it is using the models to collect the information requested. Thus, you don’t need actual database connection to use this function.
[1]:
from metacatalog import api
[4]:
api.show_attributes(table_name='persons', add_type=True)
[4]:
[('id', Integer()),
('first_name', String(length=128)),
('last_name', String(length=128)),
('affiliation', String(length=1024))]