File Format - grungi-ankhfire/ebenezer GitHub Wiki

WARNING

The below file format has been deprecated in favor of the more standard YAML file format. This page needs to be updated to document the new file format.

Ebenezer uses a simple text file format to save its data. This page provides the description of the current version of that format.

The version number is of the form major.minor. While efforts will be made to keep the file format retrocompatible, minor revisions might introduce incompatibilities. However, the major revisions will be made compatible with each other. The latest revision, however, will always remain a moving target ! Always make a backup of your file before a transition to a new file format !

Version 0.1

Comments are marked by # at the start of the line. Currently only full-line comments are supported :

# This is a comment 

is ok while

s version 0.1 # Set the app version 

is not.

The file is divided into sections a section can be delimited in three ways :

@@ SECTIONNAME
...
@@

++ SECTIONNAME
...
++

{{ SECTIONNAME
...
}}

Sections can be nested, and can contain zero or more properties. Those are defined as follows :

type name value

type can be s for string (value is then the actual string, without quotes, and can contain spaces), i for integer and f for decimal numbers. name can be any actual one-word string, usually lowercase. Each property should occupy one separate line in the file. See the following section for the currently defined sections.

Sections and properties reference

EBENEZER [Mandatory]

Provides information about the version of the file format and the version of the application that was used to generate it.

Properties

s version x.y

The version of the application, in the format major.minor.

s format x.y

The version of the file format of this file, in the format major.minor.

ACCOUNT [Optional]

Accounts holds a group of transaction, and can represent a bank account, a loan, a cash deposit, or any other group of transaction. The transactions pertaining to a given account appear as TRANSACTION sections inside the ACCOUNT section.

Properties

s name Name of the account

A string used to identify the account in the application.

f balance initial_balance

The initial (ie. at creation time) balance of the account.

s currency symbol

String defining the currency. Can be a symbol like $ or €, or an identifier like USD, JPY, or GBP. Will be displayed as-is in the application.

TRANSACTION [Optional]

A transaction is the basic object manipulated by Ebenezer. It usually represents a money transfer to or out of an account, or between two accounts. TRANSACTION sections appear inside the ACCOUNT section they relate to.

Properties

s name Name of the transaction

A string used to describe the transaction in the application. Does not need to be unique.

s date YYYYMMDD

Date at which the transaction occured, in the YYYYMMDD format, ie. 20121008 for the 8th of october 2012.

f amount sum

Decimal number giving the amount of the transaction (for instance, 50.75).

s currency symbol

String defining the currency. Can be a symbol like $ or €, or an identifier like USD, JPY, or GBP. Will be displayed as-is in the application.

s category

String stating the category the transaction is classified in.