nanome.api.schemas.ui_schemas module

class ButtonIconSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

color = <GeneratedSchema(many=False)>
opts = <marshmallow.schema.SchemaOpts object>
value = <GeneratedSchema(many=False)>
class ButtonMeshSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

enabled = <GeneratedSchema(many=False)>
opts = <marshmallow.schema.SchemaOpts object>
class ButtonOutlineSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

opts = <marshmallow.schema.SchemaOpts object>
size = <GeneratedSchema(many=False)>
class ButtonSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

flatten_attributes(obj, *args, **kwargs)[source]

Add flattened attributes from nested fields to object.

load(data, *args, **kwargs)[source]

Deserialize a data structure to an object defined by this Schema’s fields.

Parameters:
  • data – The data to deserialize.
  • many – Whether to deserialize data as a collection. If None, the value for self.many is used.
  • partial – Whether to ignore missing fields and not require any fields declared. Propagates down to Nested fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.
  • unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE. If None, the value for self.unknown is used.
Returns:

Deserialized data

New in version 1.0.0.

Changed in version 3.0.0b7: This method returns the deserialized data rather than a (data, errors) duple. A ValidationError is raised if invalid data are passed.

load_icon_values(data, btn)[source]
load_mesh_values(data, btn)[source]
load_outline_values(data, btn)[source]
load_switch_values(data, btn)[source]
load_text_values(data: dict, btn: nanome.api.ui.button.Button)[source]
load_tooltip_values(data, btn)[source]
make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class ButtonSwitchSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

opts = <marshmallow.schema.SchemaOpts object>
class ButtonTextSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

opts = <marshmallow.schema.SchemaOpts object>
value = <GeneratedSchema(many=False)>
class ButtonToolTipSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

opts = <marshmallow.schema.SchemaOpts object>
class ColorField(*, load_default: typing.Any = <marshmallow.missing>, missing: typing.Any = <marshmallow.missing>, dump_default: typing.Any = <marshmallow.missing>, default: typing.Any = <marshmallow.missing>, data_key: str | None = None, attribute: str | None = None, validate: None | typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]] = None, required: bool = False, allow_none: bool | None = None, load_only: bool = False, dump_only: bool = False, error_messages: dict[str, str] | None = None, metadata: typing.Mapping[str, typing.Any] | None = None, **additional_metadata)[source]

Bases: marshmallow.fields.Field

class ContentSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

Uses the type_name field to identify the type of content to be loaded/dumped.

dump(obj, *args, **kwargs)[source]

Serialize an object to native Python data types according to this Schema’s fields.

Parameters:
  • obj – The object to serialize.
  • many – Whether to serialize obj as a collection. If None, the value for self.many is used.
Returns:

Serialized data

New in version 1.0.0.

Changed in version 3.0.0b7: This method returns the serialized data rather than a (data, errors) duple. A ValidationError is raised if obj is invalid.

Changed in version 3.0.0rc9: Validation no longer occurs upon serialization.

load(data, *args, **kwargs)[source]

Deserialize a data structure to an object defined by this Schema’s fields.

Parameters:
  • data – The data to deserialize.
  • many – Whether to deserialize data as a collection. If None, the value for self.many is used.
  • partial – Whether to ignore missing fields and not require any fields declared. Propagates down to Nested fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.
  • unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE. If None, the value for self.unknown is used.
Returns:

Deserialized data

New in version 1.0.0.

Changed in version 3.0.0b7: This method returns the deserialized data rather than a (data, errors) duple. A ValidationError is raised if invalid data are passed.

opts = <marshmallow.schema.SchemaOpts object>
type_name_schemas = {'Button': <ButtonSchema(many=False)>, 'Dropdown': <DropdownSchema(many=False)>, 'Image': <ImageSchema(many=False)>, 'Label': <LabelSchema(many=False)>, 'List': <UIListSchema(many=False)>, 'LoadingBar': <LoadingBarSchema(many=False)>, 'Mesh': <MeshSchema(many=False)>, 'Slider': <SliderSchema(many=False)>, 'Text Input': <TextInputSchema(many=False)>, 'TextInput': <TextInputSchema(many=False)>, 'UIList': <UIListSchema(many=False)>}
class DropdownItemSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class DropdownSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class FloatRoundedField(*, allow_nan: bool = False, as_string: bool = False, **kwargs)[source]

Bases: marshmallow.fields.Float

If decimal part of float is 0, round to int.

class ImageSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class LabelSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class LayoutNodeSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class LoadingBarSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class MenuSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_menu(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class MeshSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class PositionSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

opts = <marshmallow.schema.SchemaOpts object>
class SliderSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class TextInputSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class UIListSchema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_obj(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
class Vector3Schema(*, only: types.StrSequenceOrSet | None = None, exclude: types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: types.StrSequenceOrSet = (), dump_only: types.StrSequenceOrSet = (), partial: bool | types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.schema.Schema

make_vector3(data, **kwargs)[source]
opts = <marshmallow.schema.SchemaOpts object>
create_multi_state_schema(field_class)[source]

Create a schema that can serialize a MultiStateVariable the provided type.

init_object(obj, data: dict)[source]