@@ -567,12 +567,16 @@ def add_table(self, url: str, *cols: ColSpecType, **kw) -> csvw.Table:
567567 :param cols: Column specifications; anything accepted by :func:`pycldf.dataset.make_column`.
568568 :param kw: Recognized keywords:
569569 - `primaryKey`: specify the column(s) constituting the primary key of the table.
570+ - `description`: a description of the table.
570571 :return: The new table.
571572 """
572573 t = self .add_component ({"url" : url , "tableSchema" : {"columns" : []}}, * cols )
573574 if 'primaryKey' in kw :
574575 t .tableSchema .primaryKey = attr .fields_dict (Schema )['primaryKey' ].converter (
575576 kw .pop ('primaryKey' ))
577+ if kw .get ('description' ):
578+ t .common_props ['dc:description' ] = kw .pop ('description' )
579+ t .common_props .update (kw )
576580 return t
577581
578582 def remove_table (self , table : TableType ):
@@ -600,6 +604,9 @@ def add_component(self,
600604
601605 :param component: A component specified by name or as `dict` representing the JSON \
602606 description of the component.
607+ :param kw: Recognized keywords: \
608+ - `url`: a url property for the table;\
609+ - `description`: a description of the table.
603610 """
604611 if isinstance (component , str ):
605612 component = jsonlib .load (pkg_path ('components' , '{0}{1}' .format (component , MD_SUFFIX )))
@@ -609,6 +616,8 @@ def add_component(self,
609616
610617 if kw .get ('url' ):
611618 component .url = Link (kw ['url' ])
619+ if kw .get ('description' ):
620+ component .common_props ['dc:description' ] = kw ['description' ]
612621
613622 for other_table in self .tables :
614623 if other_table .url == component .url :
0 commit comments