Source code for package_name_to_import_with.data_using_module
1"""Define package contents."""
2import importlib.resources
3import json
4
5import pydantic
6
7
[docs]
8class PackageMetadata(pydantic.BaseModel):
9 """Define keys and types of corresponding values for package metadata.
10
11 Attributes
12 ----------
13 Name : str
14 name of the package
15 Version : str
16 version of the package
17 Description : str
18 description of the package
19 Keywords : list[str]
20 keywords associated with the package
21 License : str
22 license of the package
23 Maintainers : list[str]
24 maintainers of the package
25 Authors : list[str]
26 authors of the package
27 Links : dict[str, pydantic.HttpUrl]
28 links associated with the package
29 """
30
31 Name: str
32 Version: str
33 Description: str
34 Keywords: list[str]
35 License: str
36 Maintainers: list[str]
37 Authors: list[str]
38 Links: dict[str, pydantic.HttpUrl]
39
40
41METADATA_CONTENTS: str = (
42 importlib.resources.files("package_name_to_import_with").joinpath("metadata.json").read_text()
43)
44METADATA = PackageMetadata(**json.loads(METADATA_CONTENTS))