Skip to main content

Simple Attribute saving manager

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SimConf-0.1.6.tar.gz (16.4 kB view details)

Uploaded Source

File details

Details for the file SimConf-0.1.6.tar.gz.

File metadata

  • Download URL: SimConf-0.1.6.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

File hashes

Hashes for SimConf-0.1.6.tar.gz
Algorithm Hash digest
SHA256 10466a52f3a2a42d53cf846246bc62ba748293bbb018e6bf86eaf9328a735b89
MD5 f2841ddd72b8ec8c1a7d6989abdfc4b9
BLAKE2b-256 2e65f0285d27bc1b46d76aec9e48bc9813dcf48646947fe507f7f2219e7df6c8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page