schema.datatableschema.md

January 18, 2023 ยท View on GitHub

Home > @datashaper/schema > DataTableSchema

DataTableSchema interface

This defines the table-containing resource type. A dataset can be embedded directly using the data property, or it can be linked to a raw file using the path. If the latter, optional format and parsing options can be applied to aid interpreting the file contents. resource profile: 'datatable'

Signature:

export interface DataTableSchema extends ResourceSchema 

Extends: ResourceSchema

Properties

PropertyModifiersTypeDescription
columns?number(Optional) Number of columns in the data.
data?string | unknown[](Optional) Option to embed the data directly in the JSON descriptor. Valid data formats are: - string: raw CSV data, parsed according to the parser options - array: raw JSON data, parsed according to the shape options
encoding?string(Optional) String encoding. Default: "utf-8".
format?DataFormat(Optional) File format of the resource to inform load/parse. Note that if the data property is present, this is assumed to be "JSON". Default: "csv".
parser?ParserOptions(Optional) Parser options for interpreting a CSV or other text file that needs parse instruction.
profileKnownProfile.DataTable
rows?number(Optional) Number of rows in the data.
shape?DataShape(Optional) Defines the shape and structure of stored data.
typeHints?TypeHints(Optional) Options for converting string values to strict types. Note that options related to data typing only apply if type detection is turned on. Otherwise all cell values are treated as strings. Defaults based on pandas: https://pandas.pydata.org/pandas-docs/stable/user\_guide/io.html\#csv-text-files