proxystore.utils.config¶
Read and write TOML config files using Pydantic BaseClasses.
dump
¶
Serialize data class as a TOML formatted stream to file-like object.
Parameters:
-
model
(BaseModel
) –Config model instance to write.
-
fp
(BinaryIO
) –File-like bytes stream to write to.
-
exclude_none
(bool
, default:True
) –Skip writing none attributes.
Source code in proxystore/utils/config.py
dumps
¶
Serialize data class to a TOML formatted string.
Parameters:
-
model
(BaseModel
) –Config model instance to write.
-
exclude_none
(bool
, default:True
) –Skip writing none attributes.
Returns:
-
str
–TOML string of data class.
Source code in proxystore/utils/config.py
load
¶
loads
¶
Parse TOML string to data class.
Parameters:
-
model
(type[BaseModelT]
) –Config model type to parse TOML using.
-
data
(str
) –TOML string to parse.
Returns:
-
BaseModelT
–Model initialized from TOML file.