kittycad.models.base64data.Base64Data

class kittycad.models.base64data.Base64Data(data)[source][source]

Bases: object

Initializes the object.

If the provided data is already in base64 encoded format, it will store it. If the data is a regular byte string, it will encode and then store it.

__init__(data)[source][source]

Initializes the object.

If the provided data is already in base64 encoded format, it will store it. If the data is a regular byte string, it will encode and then store it.

Methods

__init__(data)

Initializes the object.

get_decoded()

Returns the decoded byte string.

get_encoded()

Returns the stored base64 encoded data.

is_base64(data)

Checks if given data is base64 encoded.

__annotations__ = {}[source]
__dict__ = mappingproxy({'__module__': 'kittycad.models.base64data', '__init__': <function Base64Data.__init__>, 'is_base64': <staticmethod(<function Base64Data.is_base64>)>, 'get_encoded': <function Base64Data.get_encoded>, 'get_decoded': <function Base64Data.get_decoded>, '__get_pydantic_core_schema__': <classmethod(<function Base64Data.__get_pydantic_core_schema__>)>, '__dict__': <attribute '__dict__' of 'Base64Data' objects>, '__weakref__': <attribute '__weakref__' of 'Base64Data' objects>, '__doc__': None, '__annotations__': {}})[source]
classmethod __get_pydantic_core_schema__(source_type, handler)[source][source]
Return type:

Union[AnySchema, NoneSchema, BoolSchema, IntSchema, FloatSchema, DecimalSchema, StringSchema, BytesSchema, DateSchema, TimeSchema, DatetimeSchema, TimedeltaSchema, LiteralSchema, EnumSchema, IsInstanceSchema, IsSubclassSchema, CallableSchema, ListSchema, TupleSchema, SetSchema, FrozenSetSchema, GeneratorSchema, DictSchema, AfterValidatorFunctionSchema, BeforeValidatorFunctionSchema, WrapValidatorFunctionSchema, PlainValidatorFunctionSchema, WithDefaultSchema, NullableSchema, UnionSchema, TaggedUnionSchema, ChainSchema, LaxOrStrictSchema, JsonOrPythonSchema, TypedDictSchema, ModelFieldsSchema, ModelSchema, DataclassArgsSchema, DataclassSchema, ArgumentsSchema, CallSchema, CustomErrorSchema, JsonSchema, UrlSchema, MultiHostUrlSchema, DefinitionsSchema, DefinitionReferenceSchema, UuidSchema]

__init__(data)[source][source]

Initializes the object.

If the provided data is already in base64 encoded format, it will store it. If the data is a regular byte string, it will encode and then store it.

__module__ = 'kittycad.models.base64data'[source]
get_decoded()[source][source]

Returns the decoded byte string.

Return type:

bytes

get_encoded()[source][source]

Returns the stored base64 encoded data.

Return type:

str

static is_base64(data)[source][source]

Checks if given data is base64 encoded.

Return type:

bool