MCPcopy Create free account
hub / github.com/ccxt/ccxt / String

Class String

python/ccxt/static_dependencies/marshmallow/fields.py:882–905  ·  view source on GitHub ↗

A string field. :param kwargs: The same keyword arguments that :class:`Field` receives.

Source from the content-addressed store, hash-verified

880
881
882class String(Field):
883 """A string field.
884
885 :param kwargs: The same keyword arguments that :class:`Field` receives.
886 """
887
888 #: Default error messages.
889 default_error_messages = {
890 "invalid": "Not a valid string.",
891 "invalid_utf8": "Not a valid utf-8 string.",
892 }
893
894 def _serialize(self, value, attr, obj, **kwargs) -> str | None:
895 if value is None:
896 return None
897 return utils.ensure_text_type(value)
898
899 def _deserialize(self, value, attr, data, **kwargs) -> typing.Any:
900 if not isinstance(value, (str, bytes)):
901 raise self.make_error("invalid")
902 try:
903 return utils.ensure_text_type(value)
904 except UnicodeDecodeError as error:
905 raise self.make_error("invalid_utf8") from error
906
907
908class UUID(String):

Callers 15

__init__Method · 0.85
connectMethod · 0.85
formatMethod · 0.85
getFormatFunction · 0.85
constructorMethod · 0.85
_packFunction · 0.85
getBaseEncoderFunction · 0.85
address.tsFile · 0.85
ibanChecksumFunction · 0.85
__wbg_get_importsFunction · 0.85
stringifyFunction · 0.85
parseObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…