{"route":"/en-US-v0.14.1/reference/data-loading/","title":"Data Loading","description":"Documentation for functions related to Data Loading in Typst.","part":null,"outline":[{"id":"summary","name":"Summary","children":[]},{"id":"encoding","name":"Encoding","children":[]},{"id":"definitions","name":"Definitions","children":[]}],"body":{"kind":"category","content":{"name":"data-loading","title":"Data Loading","details":"<p>Data loading from external files.</p>\n<p>These functions help you with loading and embedding data, for example from the\nresults of an experiment.</p>\n<h2 id=\"encoding\">Encoding</h2>\n<p>Some of the functions are also capable of encoding, e.g. <a href=\"/en-US-v0.14.1/reference/data-loading/cbor/#definitions-encode\" title=\"`cbor.encode`\"><code>cbor.encode</code></a>. They\nfacilitate passing structured data to <a href=\"/en-US-v0.14.1/reference/foundations/plugin/\">plugins</a>.</p>\n<p>However, each data format has its own native types. Therefore, for an arbitrary\nTypst value, the encode-to-decode roundtrip might be lossy. In general, numbers,\nstrings, and <a href=\"/en-US-v0.14.1/reference/foundations/array/\">arrays</a> or <a href=\"/en-US-v0.14.1/reference/foundations/dictionary/\">dictionaries</a> composed of them\ncan be reliably converted, while other types may fall back to strings via <a href=\"/en-US-v0.14.1/reference/foundations/repr/\" title=\"`repr`\"><code>repr</code></a>,\nwhich is <a href=\"/en-US-v0.14.1/reference/foundations/repr/#debugging-only\">for debugging purposes only</a>. Please refer to\nthe page of each data format for details.</p>","items":[{"name":"cbor","route":"/en-US-v0.14.1/reference/data-loading/cbor/","oneliner":"Reads structured data from a CBOR file.","code":true},{"name":"csv","route":"/en-US-v0.14.1/reference/data-loading/csv/","oneliner":"Reads structured data from a CSV file.","code":true},{"name":"json","route":"/en-US-v0.14.1/reference/data-loading/json/","oneliner":"Reads structured data from a JSON file.","code":true},{"name":"read","route":"/en-US-v0.14.1/reference/data-loading/read/","oneliner":"Reads plain text or data from a file.","code":true},{"name":"toml","route":"/en-US-v0.14.1/reference/data-loading/toml/","oneliner":"Reads structured data from a TOML file.","code":true},{"name":"xml","route":"/en-US-v0.14.1/reference/data-loading/xml/","oneliner":"Reads structured data from an XML file.","code":true},{"name":"yaml","route":"/en-US-v0.14.1/reference/data-loading/yaml/","oneliner":"Reads structured data from a YAML file.","code":true}],"shorthands":null}}}