Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 536 Bytes

README.md

File metadata and controls

43 lines (33 loc) · 536 Bytes

Parser for properties file, which is a simple key-value file, comments is also supported.

Load from string

import properties

string = """
FULL NAME: John Doe
AGE: 42
TIME: 12:00
"""

print(properties.loads(string))
{
    "FULL NAME": "John Doe",
    "AGE": "42",
    "TIME": "12:00"
}

Dump to string

import properties

props = {
    "FULL NAME": "John Doe",
    "AGE": "42",
    "TIME": "12:00"
}

print(properties.dumps(props))
FULL NAME: John Doe
AGE: 42
TIME: 12:00