scippneutron.metadata.Software#
- class scippneutron.metadata.Software(**data)[source]#
A piece of software.
The piece of software should be specified as precisely as possible. For example, a release version of ScippNeutron could be specified as follows:
>>> from scippneutron.metadata import Software >>> software = Software( ... name='ScippNeutron', ... version='24.11.0', ... url='https://github.com/scipp/scippneutron/releases/tag/24.11.0', ... doi='https://doi.org/10.5281/zenodo.14139599', ... )
A development version might include a Git hash in the version. Alternative methods can be used for projects that do not use Git. But the software should be specified as precisely as possible. For example:
>>> software = Software( ... name='ScippNeutron', ... version='24.11.1.dev8+g10d09ab0', ... url='https://github.com/scipp/scippneutron', ... )
The URL can either point to the source code, a release artifact, or a package index, such as
pypi.org
oranaconda.org
.Attributes
A representation of this software as a single short string.
model_computed_fields
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extra
Get extra fields set during validation.
model_fields
model_fields_set
Returns the set of fields that have been explicitly set on this model instance.
The name and version of the software, separated by a space.
Name of the piece of software.
Complete version of the piece of software.
URL to the concrete version of the software.
DOI of the concrete version of the software.
- doi: str | None#
DOI of the concrete version of the software.
If there is no DOI for the concrete version, a general DOI for the software may be used.
- classmethod from_package_metadata(package_name)[source]#
Construct a Software instance from the metadata of an installed package.
This function attempts to deduce all information it can from package metadata. But it only has access to the information that is encoded in the package. It therefore returns the base project URL instead of a concrete release URL, and it does not return a DOI.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str#
Name of the piece of software.
- url: str | None#
URL to the concrete version of the software.
If no URL for a concrete version is available, a URL of the project or source code may be used.
- version: str#
Complete version of the piece of software.