properties.py

Module for reading/writing properties-files.


Keywords
properties, java, io, file, read, write
License
MIT
Install
pip install properties.py==1.2.1

Documentation

properties.py

Description

Module for reading/writing properties-files.

Installation

pip install -U properties.py

Usage

Code

import properties

user = {"name": "NoName", "age": -1, "sex": "M", "data": {"region": 39, "keywords": ["man", "human", 14.88]}}

with open("test.properties", "w", encoding="utf-8", errors="ignore") as file:
    properties.dump(user, file)

with open("test.properties", "r", encoding="utf-8", errors="ignore") as file:
    data = properties.load(file)

print(data)

Output

{'name': 'NoName', 'age': -1, 'sex': 'M', 'data': {'region': 39, 'keywords': ['man', 'human', 14.88]}}