Skip to content

bokonV2/SimConf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Config

Simple Attribute saving manager

Installation

pip install simconf

Documentation

Init

from SimConf import SimConf
config = SimConf(filename, default_atr, ensure_ascii, load_conf)

filename

filename = "filename"
  (create filename.json)

filename = "folder/filename"
  (create filename.json in folder)

default_atr

default_atr = {"key0": 0, "key1": 1 ...}
default_atr = ["arg0", "arg1" ...]
default_atr = {"key": {"key": [],},} etс.

ensure_ascii

Standard json attribute

ensure_ascii = bool()

load_conf

if true, loads values from file, if there is no file, uses default_atr, if false, uses default_atr

load_conf = bool()

Use

Get arg

  ####Dict
arg = config["key"]
arg = config.get("key")

  ####List
arg = config[int(key)]
arg = config.get(int(key))

Set atr and create new

####Dict
config["key"] = atr
config["keyNew"] = atr
config.append("key", atr)

####List
config.append(atr)
config[int(key)] = atr

Set default data

config.set_default() #use default_atr

Get default data

data = config.get_default()

Get data

data = config.data

Print in console all saves

config.print_all()

Get Len

len(config)

Get Iterable items

config.__iter__()
config.keys()
config.values()
config.items()

Forcibly get data

data = config.load()

Forcibly save data

data = config.save()

Print data in console

config.print_all()

Support

About

Simple Attribute saving manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages