Metadata-Version: 2.1
Name: python_json_config
Version: 1.0.0
Summary: This library allows to load json configs and access the values like members (i.e., via dots), validate config field types and values and transform config fields.
Home-page: https://github.com/janehmueller/python-config
Author: Jan Ehmueller
Author-email: jan@ehmueller.de
License: MIT
Description: 
        [![Build Status](https://travis-ci.com/janehmueller/python-config.svg?token=tGKCTy4zTZfGNfjpEgEX&branch=master)](https://travis-ci.com/janehmueller/python-config)
        
        # Overview
        This library allows to load json configs and access the values like members (i.e., `config.server.port`
        instead of `config['server']['port']`), validate the data types of fields and transform the values of fields.
        
        # Installing
        ```
        pip install git+https://github.com/janehmueller/python-json-config
        ```
        # Usage
        ```
        from python_json_config import ConfigBuilder
        from datetime import datetime
        
        # create config parser
        builder = ConfigBuilder()
        
        # assert that port contains an int value
        builder.validate_field_type('server.port', int)
        
        # assert that the port is not a reserved port 
        builder.validate_field_value('server.port', lambda port: port > 1024)
        
        # parse a date string (e.g., Jun 1 2005) into a datetime object
        builder.transform_field_value('important_date', lambda date: datetime.strptime(date, '%b %d %Y'))
        
        # parse config
        config = builder.parse_config('path/to/config.json')
        
        # access config values
        port = config.server.port
        assert isinstance(port, int)
        important_date = config.important_date
        assert isinstance(important_date, datetime)
        ```
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Intended Audience :: Developers
Requires-Python: >=3.6
Description-Content-Type: text/markdown
