Skip to main content

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")

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.5.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file cnfrm-0.2.5.tar.gz.

File metadata

  • Download URL: cnfrm-0.2.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for cnfrm-0.2.5.tar.gz
Algorithm Hash digest
SHA256 00a4c954356cf1949fb7dfdead941c7e982e0ffc160fdb967e262a986667da29
MD5 b080d5ae78651614eb76fe212d434d8e
BLAKE2b-256 84ce8921a955a5dc0bc0b13674f435549d5d799120c6f4de249a85fb92641fe8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.5 This release

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page