Merging configuration files and programming languages so you don't have to create an interpreter for every project.
Get ACF syntax hightlighting for VS Code here.
Install with pip install acfile
from acfile import read_file
config = read_file("<FILE_PATH>.acf")
To read values, get the section name and then the value name from the acf object.
print(config.SECTION_NAME.VALUE_NAME)
The file extension for an acf file is .acf
.
ACF has a section-based structure where the header is preceded by an @
symbol. Example: @header
. Each section contains key-value pairs.
A value contains a name and a value seperated by an equals symbol. Text values must be enclosed with speech marks.
Example:
text = "this is text"
number = 42
As long as the value is in the same section, you can refernce them to perform math operations on. Order of operations is supported
a = 12
b = 2 + 3 * a
The value b
will have the value of 38
.
a = "hello"
b = 3 * a
The value b
will be "hellohellohello" as operators on strings have the same behaviour as in Python.
Inline comments begin with a semicolon ;
.