cldf / pycldf

python package to read and write CLDF datasets
https://cldf.clld.org
Apache License 2.0
15 stars 7 forks source link

Allow passing common_props in Dataset.add_component/add_table #180

Open xrotwang opened 2 months ago

xrotwang commented 2 months ago

We often use code like

t = cldf.add_component(...)
t.common_props['dc:description'] = ...

This could be written more concisely with an API that allowed passing data to be used in common_props. While this could be done in a generic way, just funneling **kwargs to common_props, arguably the most often used property is dc:description, which cannot be used as keyword argument name in Python. Thus, just adding one keyword argument description to Dataset.add_component|add_table might hit the sweet spot here.