CnfRM - ORM for config
Project description
CnfRM
Imagine: an ORM for config
This library lets you declare your config in a way you might know from popular ORM's.
You get
- expressive configuration declaration
- popular fileformats (json, yml?)
- command line options
- env configuration variables
import cnfrm
class MyConf(cnfrm.Config):
name = cnfrm.Field("no name")
size = cnfrm.IntegerField(required=False)
path = cnfrm.DirectoryField(required=False)
email = cnfrm.EmailField(required=False)
filename = cnfrm.FileField()
# create a config instance
config = MyConf()
# start reading things, the later overwrites the former
config.read_env()
config.read_json("~/myconf.json", quiet=True)
config.read_args()
# check if the configuration is complete
config.validate()
# write config to file:
config.write_json("~/myconf.json")
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
cnfrm-0.2.3.tar.gz
(3.9 kB
view details)
File details
Details for the file cnfrm-0.2.3.tar.gz
.
File metadata
- Download URL: cnfrm-0.2.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7231c22ae5718f6d647672bd1e267b6bf36795609e2ce6c246849d16d7ef5434 |
|
MD5 | 1aa804099665f8a6c2fa3d1e129dda17 |
|
BLAKE2b-256 | b54b2ec20569cf75d43b0e6e645cd2b1ec9dbdfe28580cb5b5fb17e675fd88ab |