Type overview
pxt.Audio, pxt.Video, and pxt.Document return file paths when queried. Pixeltable automatically downloads and caches remote media locally. Use .fileurl to get the original URL.Basic types
Auto-generated UUIDs
Useuuid7() to create columns that auto-generate unique identifiers:
Media types
Pixeltable natively supports images, video, audio, and documents as first-class column types.Image specialization
Images can be constrained by resolution and/or color mode:Array types (embeddings & tensors)
Arrays are used for embeddings, feature vectors, and tensor data. They must always specify a shape and dtype.Array shapes follow NumPy conventions. Use
None for unconstrained dimensions:(512,)— fixed 512-element vector(None, 768)— variable-length sequence of 768-dim vectors(64, 64, 3)— fixed 64×64×3 tensor
Working with arrays
JSON type
TheJson type stores flexible structured data—dictionaries, lists, or primitives.
JSON path access
Access nested data using dictionary or attribute syntax:JSON schema validation
Validate JSON columns against a schema to ensure data integrity:Using Pydantic models
Type conversion
Useastype() to convert string file paths or URLs to media types:
Image, Video, Audio, Document).
Column properties
Media column properties
Media columns (Image, Video, Audio, Document) have special properties:
Error properties
Computed columns haveerrortype and errormsg properties for debugging:
Best practices
Use Specific Types
Prefer
pxt.Image[(224,224), 'RGB'] over pxt.Image when you know the constraints. This enables optimizations and catches errors early.Validate JSON
Use JSON schema validation or Pydantic models for structured data to ensure consistency across your pipeline.
Specify Array Shapes
Always specify array shapes and dtypes. Use
None for variable dimensions: pxt.Array[(None, 768), pxt.Float].Handle Errors Gracefully
Use
on_error='ignore' in production pipelines, then query .errortype and .errormsg to debug failures.See also
Tables & Data Operations
Creating and managing tables
Computed Columns
Transform data with computed columns
SDK Reference
Complete type reference