Data Licenses#

class metacatalog.models.license.License(**kwargs)#

License represents usage information and limitations that is distributed with each Entry. If the Entry records are further grouped by a Composite it is highly recommended to use the same License on all childs. metacatalog ships with a number of open data licenses and it is recommended to only use existing data licenses.

Changed in version 0.1.9: Either full_text or link have to be not NULL

id#

Unique id of the record. If not specified, the database will assign it.

Type:

int

short_title#

The abbreviation of the license title (max 40 letters). Usually Licenses are more known under their short title, like ‘GPL-3’

Type:

str

title#

The full title of the License agreement.

Type:

str

summary#

Optional, but highly recommended to fill. The summary should give the user the most important information from the license in an understandable not legal binding manner. The license itself is stored as full_text or referenced via link.

Type:

str

full_text#

Full license text. This is the legally binding contract that has to be acknowleged by the user. It specifies the terms of usage for the reference data set. Instead of copying the full text to metacatalog, a link to a permanent version of the license can be given. One of either is mandatory

Note

It is highly recommended to use existing licenses to assure that they are legally correct.

Type:

str

URI link to the full license text. If possible, make sure that the URI links a page of type 'text/plain' to return the license text in a user fiendly way.

Type:

str

by_attribution#

If True (default) this dataset has to be cited on usage.

Type:

bool

share_alike#

If True (default) this dataset has to be licensed by the same license on distribution.

Type:

bool

commercial_use#

If True (default) this dataset can be used for commerical purposes

Type:

bool

get_full_text() str#

Return the full text license code. If full_text is not given, the full license code will be loaded from link.

..versionadded:: 0.1.9

:raises connection_error : Exception: If the link cannot be followed or does not return the expected output

Returns:

full_text – The full license text

Return type:

str

to_dict(deep: bool = False) dict#

Return the model as a python dictionary.

Parameters:

deep (bool) – If True, all related objects will be included as dictionary. Defaults to False

Returns:

obj – The Model as dict

Return type:

dict