Help:Tabular Data

Tabular data allows users to create CSV-like tables of data, and use them from other wikis to create automatic tables, lists, and graphs.

To create a new table, go to Wikimedia Commons, and create a new page in the Data namespace with a .tab suffix, such as. For now, page content can only be edited in the raw JSON format. Eventually, we hope there will be a spreadsheet-like editor to simplify data editing.

Tabular JSON data supports several basic value types:
 * - A numeric value a signed decimal number that may contain a fractional part and may use exponential E notation, but cannot include non-numbers like NaN. The format makes no distinction between integer and floating-point.
 * - only allows  and   values.
 * - a text string no longer than 400 characters long. Special characters like new lines  and tabs   are not allowed.
 * - A multilingual string, represented as an object with keys being language codes (e.g. "en"), and values being a string with above limitations of 400 max chars. For example,  has string values for both English and French.

Tabular data has several required and optional top-level elements:
 * The  field must always be set to , because, for now, tabular data only supports CC0 (Public Domain dedication) license. More license support may be available in the future.
 * The  field must be set to an object with at least one key-value, where the key is a language code (e.g. "en"), and the value is a description string (max 400 chars, no new lines)
 * The  field must be set to a list of unique strings. Each header must begin with a letter, and only contain latin characters or digits (A..Z, a-z, 0-9). This is done so that each header can be easily used from a coding environment like Lua or Vega graphs.
 * The  field is an optional translation for each column's header. If set, it must be a list of localized string objects. Must have the same number of list elements as the "headers" field.
 * The  field must always be set to a list of types (strings), each type being either ,  ,  , or  . The list must be the same size as the list of.
 * The  field must always be set to a list of lists. Each sub-list must have the same number of elements as headers, and must mach the value types.

There are two ways to use this data:
 * A Lua script on any wiki can get this data by calling . The function returns tabular data in almost the same format as the original JSON, except that all localized strings will be converted to regular strings, and the license field will also include a localized license name. To get the data in another language, pass language code as the second parameter. To get the data in the original, unmodified form, use "_" as the language code.
 * A Vega graph can get tabular data by using  as the data source url.