YAML - Maple Help

Online Help

All Products    Maple    MapleSim


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

tablefounded=1988,address=tablepostalCode=N2V 1K8,province=ON,streetAddress=615 Kumpf Drive,country=Canada,city=Waterloo,phoneNumbers=tabletype=local,number=+1 (519) 747-2373,tabletype=toll-free,number=+1 (800) 267-6583,tabletype=fax,number=+1 (519) 747-5284,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