YAML (.yml, .yaml) File Format - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Formats : Formats/YAML

YAML (.yml, .yaml) File Format

YAML file format

 

Description

Examples

References

Description

• 

YAML (YAML Ain't Markup Language) is a lightweight text-based data standard for describing structured data.

• 

As a human-readable format, it offers an alternative to explicitly tagged structured data such as XML. The JSON format is a subset of YAML 1.2.

• 

The YAML package provides tools for parsing and generating YAML expressions.

• 

The general-purpose commands Import and Export also support this format.

Examples

Parse a YAML string as an expression.

YAML:-ParseString[1, 2, 3.265, 6.01, 7.373]

1,2,3.265,6.01,7.373

(1)

Import data from a file in YAML format.

Importexample/address.yaml,base=datadir

tableaddress=tablecity=Waterloo,postalCode=N2V 1K8,province=ON,country=Canada,streetAddress=615 Kumpf Drive,founded=1988,phoneNumbers=tablenumber=+1 (519) 747-2373,type=local,tablenumber=+1 (800) 267-6583,type=toll-free,tablenumber=+1 (519) 747-5284,type=fax,companyName=Maplesoft

(2)

Export data to a YAML file in the home directory of the current user.

MousetableGenus=Mus,Species=musculus

MousetableGenus=Mus,Species=musculus

(3)

MouseFamilyMuridae

MouseFamilyMuridae

(4)

MouseOrderRodentia

MouseOrderRodentia

(5)

MouseClassMammalia

MouseClassMammalia

(6)

Exportmouse.yaml,Mouse,base=homedir

80

(7)

References

  

YAML 1.2 Language Specification, http://www.yaml.org/spec/1.2/spec.html, yaml.org.

See Also

Formats

Formats,JSON