コンテンツへスキップ
uencoder

INI

INI は伝統的な設定ファイル形式である。[section] ヘッダーと key=value ペアで設定をグループ化する。シンプルだが標準化されておらず、実装ごとに細部が異なる。

目的

ネスト不要な小規模なフラットなキー・バリュー設定に、最も単純な設定形式を提供する。

メカニズム

セクション([section])とキー・バリューペア(key=value)で構成され、コメントは ; または # で示す。ネスト構造も型もない(すべて文字列)。Windows の .ini ファイルや Python の configparser が一般的な実装で、構文の細部は異なる。

ユースケース

  • Windows 設定ファイル
  • Git の .gitconfig
  • Python の configparser モジュール
  • レガシーアプリケーション設定

例

  • 入力
    [user]
    name = Ada
    Output
    The section {user:{name:"Ada"}}

    Everything is a string

よくあるエラー

Implementations differ in syntax (comment markers, case handling)
Pin down the target implementation and consult its documentation

関連用語

関連ツール

References