Skip to content

Latest commit

 

History

History
194 lines (134 loc) · 2.24 KB

examples.md

File metadata and controls

194 lines (134 loc) · 2.24 KB

Examples

Single Documents

scalar

6
6

Roundtripable? Yes

binary

b'hello world'
![bytes](data:image/png;base64,aGVsbG8gd29ybGQ=)

Roundtripable? Yes

list of scalars

[1, 2, 3]
- 1
- 2
- 3

Roundtripable? Yes

list of scalars and lists

[1, 2, 3, ['a', 'b', 'c']]
- 1
- 2
- 3
  - a
  - b
  - c

Roundtripable? Yes

list of binary

[b'hello world', b'hello universe']
- ![bytes](data:image/png;base64,aGVsbG8gd29ybGQ=)
- ![bytes](data:image/png;base64,aGVsbG8gdW5pdmVyc2U=)

Roundtripable? No

list of dictionaries

[{'animal': 'cat', 'name': 'Frisky'}, {'animal': 'dog', 'name': 'Fido'}]
| animal | name   |
| ------ | ------ |
| cat    | Frisky |
| dog    | Fido   |

Roundtripable? Yes

dictionaries of strings

{'animal': 'cat', 'name': 'Frisky'}
# animal

cat

# name

Frisky

Roundtripable? Yes

dictionaries of binary

{'animal': b'hello world', 'name': b'hello universe'}
# animal

![bytes](data:image/png;base64,aGVsbG8gd29ybGQ=)

# name

![bytes](data:image/png;base64,aGVsbG8gdW5pdmVyc2U=)

Roundtripable? Yes

dictionary of lists

{'ages': [24, 59, 45], 'countries': ['US', 'Canada', 'Iceland']}
- ages
  - 24
  - 59
  - 45
- countries
  - US
  - Canada
  - Iceland

Roundtripable? No

dictionary of dictionaries

{'Best Cat': {'animal': 'cat', 'name': 'Frisky'}, 'Best Dog': {'animal': 'dog', 'name': 'Fido'}}
# Best Cat

| animal | name   |
| ------ | ------ |
| cat    | Frisky |

# Best Dog

| animal | name |
| ------ | ---- |
| dog    | Fido |

Roundtripable? No

Examples of multiple document in one file

two scalar documents

['abc', 123]
abc
---

123

two dictionary documents

[{'cat': 'Frisky'}, {'dog': 'Fido'}]
# cat

Frisky

---

# dog

Fido