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

Data

TOML Tom's Obvious Minimal Language

設定ファイルで使われるテキスト形式。キー値、テーブル、配列を人間が読みやすく記述できます。

Extensions .toml
MIME application/toml, text/toml

マジックナンバー

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

構造

  1. Key-value pairs
  2. Tables
  3. Arrays
  4. Dotted keys

注意点

  • TOML一般には固定マジックナンバーがなく、内容解析で判定します。

判定コード例

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

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

実践的な使い方

ユースケース

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

よくある判定ミス

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

セキュリティ上の注意

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

サンプルの活用

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

サンプルファイル

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

Blue Sky TOML

Blue Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.toml
Type Sample
Small file
187 B
SHA-256 312faa01897345103b27d4e8f188a299d8d1d4a6d546af0c3e99e2bd3b0695d8
Download
Data

Flower Garden TOML

Flower Garden TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.toml
Type Sample
Small file
264 B
SHA-256 e713a99d0720e76e1d9abcea925f141dcb06c3dfdb6930425af3b5753cef8c80
Download
Data

Navy Blue Sky TOML

Navy Blue Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.toml
Type Sample
Small file
303 B
SHA-256 d5df9b2f3c96aaf5fbea0fcbdbc91f096aff024f85af0a61777c842fb32d9de4
Download
Data

Nature of the Sky TOML

Nature of the Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.toml
Type Sample
Small file
358 B
SHA-256 8b62e6c775987162a09aa4b6fd145a2c7c7e19c08f491330330ff912a3b88932
Download
Data

Sky Landscape TOML

Sky Landscape TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.toml
Type Sample
Small file
406 B
SHA-256 21be5330f1d8956a5a574c988ca73d06fe23be869bba4b4cd3416b859d3ffe17
Download
Data

Starry Sky TOML

Starry Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.toml
Type Sample
Small file
418 B
SHA-256 25139bc5bf0390aa4af11c958a2fb86a53cbe02c6ef0d28d5ee6de894a7ab7b1
Download
Data

Blue Night Sky TOML

Blue Night Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.toml
Type Sample
Small file
484 B
SHA-256 2aa8f24c2528c2144fb361a85235752e7ddda9a657ff6e5378ada7ad34a22d8b
Download
Data

Hibiscus Flower TOML

Hibiscus Flower TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.toml
Type Sample
Small file
567 B
SHA-256 b2549b4d5dea22350ac75c6c4df3974c08b87484d171af0c5fa052e97c5ad695
Download
Data

Arctic Sky TOML

Arctic Sky TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.toml
Type Sample
Small file
552 B
SHA-256 d10fd4cb67ee9441d95e8aafb2a5e7743b37a28b4a60842d4f2903c2f3c537b1
Download
Data

Sunset Rays TOML

Sunset Rays TOML is a Tom's Obvious Minimal Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.toml
Type Sample
Small file
610 B
SHA-256 6289708add4c657e258c07408df71a649da10bcd2ed560bbc18186cc3f5ae14b
Download
Data

NASA Blue Marble TOML

NASA Blue Marble TOML is a Tom's Obvious Minimal 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.toml
Type Sample
Small file
873 B
SHA-256 6374658e0a4ae88f04f79463833a659b68c1ee8f5f1faa39da7c1da63f16f18b
Download

よくある質問

Tom's Obvious Minimal Language のマジックナンバー(ファイルシグネチャ)は?

Tom's Obvious Minimal Language ファイルはバイトシグネチャ 74 69 74 6C 65 20 3D ("title =") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Tom's Obvious Minimal Language のMIMEタイプは?

Tom's Obvious Minimal Language のMIMEタイプは application/toml, text/toml です。

Tom's Obvious Minimal Language の拡張子は?

Tom's Obvious Minimal Language ファイルは .toml 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット