ProtoModel
- pydantic model qcelemental.models.ProtoModel[source]
QCSchema extension of pydantic.BaseModel.
Show JSON schema
{ "title": "ProtoModel", "description": "QCSchema extension of pydantic.BaseModel.", "type": "object", "properties": {}, "additionalProperties": false }
- compare(other, **kwargs)[source]
Compares the current object to the provided object recursively.
- Parameters:
other (
Union
[ProtoModel
,BaseModel
]) – The model to compare to.**kwargs – Additional kwargs to pass to
compare_recursive()
.
- Returns:
True if the objects match.
- Return type:
- dict(**kwargs)[source]
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- json(**kwargs)[source]
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- classmethod parse_file(path, *, encoding=None)[source]
Parses a file into a Model object.
- Parameters:
- Returns:
The requested model from a serialized format.
- Return type:
Model
- classmethod parse_raw(data, *, encoding=None)[source]
Parses raw string or bytes into a Model object.
- serialize(encoding, *, include=None, exclude=None, exclude_unset=None, exclude_defaults=None, exclude_none=None)[source]
Generates a serialized representation of the model
- Parameters:
encoding (
str
) – The serialization type, available types are: {‘json’, ‘json-ext’, ‘msgpack-ext’}include (
Optional
[Set
[str
]]) – Fields to be included in the serialization.exclude (
Optional
[Set
[str
]]) – Fields to be excluded in the serialization.exclude_unset (
Optional
[bool
]) – If True, skips fields that have default values provided.exclude_defaults (
Optional
[bool
]) – If True, skips fields that have set or defaulted values equal to the default.exclude_none (
Optional
[bool
]) – If True, skips fields that have valueNone
.
- Returns:
The serialized model.
- Return type: