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. Get ConfiRMation, defaults, popular fileformats and command line configuration with expressive configuration declaration:
import cnfrm
class MyConf(cnfrm.Config):
name = Field("no name")
size = IntegerField(required=False)
path = DirectoryField(required=False)
email = EmailField(required=False)
filename = 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.dump_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.1.tar.gz
(3.8 kB
view details)
File details
Details for the file cnfrm-0.1.tar.gz
.
File metadata
- Download URL: cnfrm-0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fad44f8f41a224191c85cc874787ff905086923f8e0522e97062953c181befcf |
|
MD5 | ef35e4dd659f193485643a646d14e319 |
|
BLAKE2b-256 | ab2f4d42d8735ff3ac81488c2a0963dddf533dec979105016941476dd04610e9 |