fields-metadata 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ """fields-metadata: A Python library for extracting field metadata from dataclasses and Pydantic models."""
2
+
3
+ from fields_metadata.annotations import (
4
+ HumanReadableId,
5
+ InternationalURNAnnotation,
6
+ Multiline,
7
+ SemanticClassification,
8
+ )
9
+ from fields_metadata.exceptions import (
10
+ FieldMetadataError,
11
+ InvalidTypeUnionError,
12
+ NoneTypeFieldError,
13
+ )
14
+ from fields_metadata.extractor import MetadataExtractor
15
+ from fields_metadata.metadata import FieldMetadata
16
+ from fields_metadata.path import FieldsMetadataMap, FieldsPath
17
+
18
+ __version__ = "1.0.0"
19
+
20
+ __all__ = [
21
+ "MetadataExtractor",
22
+ "FieldMetadata",
23
+ "FieldsPath",
24
+ "FieldsMetadataMap",
25
+ "Multiline",
26
+ "HumanReadableId",
27
+ "SemanticClassification",
28
+ "InternationalURNAnnotation",
29
+ "FieldMetadataError",
30
+ "InvalidTypeUnionError",
31
+ "NoneTypeFieldError",
32
+ "__version__",
33
+ ]
@@ -0,0 +1,43 @@
1
+ """Custom annotation types for field metadata."""
2
+
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class Multiline:
8
+ """Annotation to mark a string field as multiline text."""
9
+
10
+
11
+ @dataclass(frozen=True)
12
+ class HumanReadableId:
13
+ """Annotation to mark a field as a human-readable identifier."""
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class SemanticClassification:
18
+ """
19
+ Annotation for semantic classification of a field.
20
+
21
+ :param classification: The semantic classification value
22
+ """
23
+
24
+ classification: str
25
+
26
+
27
+ @dataclass(frozen=True)
28
+ class InternationalURNAnnotation:
29
+ """Annotation to mark a field as an international URN."""
30
+
31
+
32
+ @dataclass(frozen=True)
33
+ class NonCategorical:
34
+ """Annotation to mark a field as non-categorical."""
35
+
36
+
37
+ __all__ = [
38
+ "Multiline",
39
+ "HumanReadableId",
40
+ "SemanticClassification",
41
+ "InternationalURNAnnotation",
42
+ "NonCategorical",
43
+ ]
@@ -0,0 +1,20 @@
1
+ """Custom exceptions for fields-metadata library."""
2
+
3
+
4
+ class FieldMetadataError(Exception):
5
+ """Base exception for fields-metadata library."""
6
+
7
+
8
+ class InvalidTypeUnionError(FieldMetadataError):
9
+ """Raised when a field has a union between non-None types."""
10
+
11
+
12
+ class NoneTypeFieldError(FieldMetadataError):
13
+ """Raised when a field has only None as its type."""
14
+
15
+
16
+ __all__ = [
17
+ "FieldMetadataError",
18
+ "InvalidTypeUnionError",
19
+ "NoneTypeFieldError",
20
+ ]