file in abyss
フォーマット一覧へ戻る

Data

YAML YAML Ain’t Markup Language

設定ファイルやデータ記述で広く使われる人間が読みやすいテキスト形式。固定のバイナリシグネチャはありません。

Extensions .yaml, .yml
MIME application/yaml, text/yaml

マジックナンバー

ファイルを解析
オフセット 0 このサイトのYAMLサンプルで使う先頭キー
74 69 74 6C 65 3A
title:

構造

  1. Documents
  2. Mappings
  3. Sequences
  4. Scalars

注意点

  • YAML一般には固定マジックナンバーがありません。内容解析や拡張子と組み合わせて判定します。

判定コード例

SIGNATURE = bytes.fromhex("7469746c653a")
OFFSET = 0

def is_yaml(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

YAML Ain’t Markup Language はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .yaml / .yml という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • YAML Ain’t Markup Language は 74 69 74 6C 65 3A のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Data

Blue Sky YAML

Blue Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.yaml
Type Sample
Small file
185 B
SHA-256 0f6ffd57cd39429ef5ffa4f6991d0538f24f1add9569999562ce04b942d2d376
Download
Data

Flower Garden YAML

Flower Garden YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.yaml
Type Sample
Small file
257 B
SHA-256 dd741065e0186333a677b530975c934fd052fe7d672bb53746c5e86a52d8bea3
Download
Data

Navy Blue Sky YAML

Navy Blue Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.yaml
Type Sample
Small file
291 B
SHA-256 98431cf0f854d07f47f9d99219d28e4dce87b753b35b78a9aaf750c972b782c5
Download
Data

Nature of the Sky YAML

Nature of the Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.yaml
Type Sample
Small file
341 B
SHA-256 6cfd66f8a3f6391bce8291452f851ccff9b359b9436e7ceeb82855f96f488b7f
Download
Data

Sky Landscape YAML

Sky Landscape YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.yaml
Type Sample
Small file
384 B
SHA-256 59ffd56784b0c6233a867ba538b25dd741737a7372176accca405e50e9c6ca81
Download
Data

Starry Sky YAML

Starry Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.yaml
Type Sample
Small file
391 B
SHA-256 c4c03b904441a9b77d20f23eb15af66255c0bb17cc2bf1bdb327a7b088a73381
Download
Data

Blue Night Sky YAML

Blue Night Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.yaml
Type Sample
Small file
452 B
SHA-256 e4cc3804885f18f7b696fa22d7232170e584f10a1ca199aefbaafed4df688b00
Download
Data

Hibiscus Flower YAML

Hibiscus Flower YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.yaml
Type Sample
Small file
530 B
SHA-256 722fb2f424628791e265901aff3fd1ca55e27e721d0c138d5e5752b457735d21
Download
Data

Arctic Sky YAML

Arctic Sky YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.yaml
Type Sample
Small file
510 B
SHA-256 fd0d557c83c5914bfe69a6c76d9f7f1a52e7ebc03b5a19e2afc53cb8f3f51810
Download
Data

Sunset Rays YAML

Sunset Rays YAML is a YAML Ain’t Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.yaml
Type Sample
Small file
563 B
SHA-256 4efad6d8a06c0965b158bb5e9fac03d45ec2fe4eeb9c1c2b5c62767ced5a26dc
Download
Data

NASA Blue Marble YAML

NASA Blue Marble YAML is a YAML Ain’t Markup Language sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.yaml
Type Sample
Small file
821 B
SHA-256 8e37e194ab4ff8cee72db6ad2c6fe0e35ad70fd5e3bf7c97067eca2e0b8b07e3
Download

よくある質問

YAML Ain’t Markup Language のマジックナンバー(ファイルシグネチャ)は?

YAML Ain’t Markup Language ファイルはバイトシグネチャ 74 69 74 6C 65 3A ("title:") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

YAML Ain’t Markup Language のMIMEタイプは?

YAML Ain’t Markup Language のMIMEタイプは application/yaml, text/yaml です。

YAML Ain’t Markup Language の拡張子は?

YAML Ain’t Markup Language ファイルは .yaml, .yml 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット