erdantic.plugins.attrs¶
get_fields_from_attrs_class
¶
Given an attrs class, return a list of FieldInfo instances for each field in the class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
AttrsClassType
|
The attrs class to get fields from. |
required |
Returns:
Type | Description |
---|---|
List[FieldInfo]
|
List of FieldInfo instances for each field in the class |
Source code in erdantic/plugins/attrs.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
is_attrs_class
¶
is_attrs_class(obj: Any) -> TypeGuard[AttrsClassType]
Predicate function to determine if an object is an attrs class (not an instance).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
Any
|
The object to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the object is an attrs class, False otherwise. |
Source code in erdantic/plugins/attrs.py
19 20 21 22 23 24 25 26 27 28 |
|