Class: QgsProjectMetadata

A structured metadata store for a project.

QgsProjectMetadata handles storage and management of the metadata for a QgsProject. This class is an internal QGIS format with a common metadata structure, which allows for code to access the metadata properties for projects in a uniform way.

The metadata store is designed to be compatible with the Dublin Core metadata specifications, and will be expanded to allow compatibility with ISO specifications in future releases. However, the QGIS internal schema does not represent a superset of all existing metadata schemas and accordingly conversion from specific metadata formats to QgsProjectMetadata may result in a loss of information.

This class is designed to follow the specifications detailed in the schema definition available at resources/qgis-project-metadata.xsd within the QGIS source code.

Metadata can be validated through the use of QgsLayerMetadataValidator subclasses. E.g. validating against the native QGIS metadata schema can be performed using QgsNativeProjectMetadataValidator.

Added in version 3.2.

Class Hierarchy

Inheritance diagram of qgis.core.QgsProjectMetadata

Base classes

QgsAbstractMetadataBase

An abstract base class for metadata stores.

Methods

author

Returns the project author string.

creationDateTime

Returns the project's creation date/timestamp.

setAuthor

Sets the project author string

setCreationDateTime

Sets the project's creation date/timestamp.

class qgis.core.QgsProjectMetadata[source]

Bases: QgsAbstractMetadataBase

author(self) str[source]

Returns the project author string.

See also

setAuthor()

Return type:

str

creationDateTime(self) QDateTime[source]

Returns the project’s creation date/timestamp.

Return type:

QDateTime

setAuthor(self, author: str | None)[source]

Sets the project author string

See also

author()

Parameters:

author (Optional[str])

setCreationDateTime(self, creationDateTime: QDateTime | datetime.datetime)[source]

Sets the project’s creation date/timestamp.

Parameters:

creationDateTime (Union[QDateTime, datetime.datetime])