Metadata-Version: 1.2
Name: conff
Version: 0.3.2
Summary: Simple config parser with evaluator library.
Home-page: https://github.com/kororo/conff
Author: Robertus Johansyah
Author-email: kororola@gmail.com
License: UNKNOWN
Download-URL: https://github.com/kororo/conff/tarball/0.3.2
Description: conff
        =====
        
        Simple config parser with evaluator library.
        
        .. image:: https://badge.fury.io/py/conff.svg
            :target: https://badge.fury.io/py/conff
        
        .. image:: https://travis-ci.com/kororo/conff.svg?branch=master
            :target: https://travis-ci.com/kororo/conff
        
        .. image:: https://coveralls.io/repos/github/kororo/conff/badge.svg?branch=master
            :target: https://coveralls.io/github/kororo/conff?branch=master
        
        .. image:: https://api.codeclimate.com/v1/badges/c476e9c6bfe505bc4b4d/maintainability
            :target: https://codeclimate.com/github/kororo/conff/maintainability
            :alt: Maintainability
        
        
        Why Another Config Parser Module?
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        This project inspired of the necessity complex config in a project. By means complex:
        
        - Reusability
        
          - Import values from file
          - Reference values from other object
        
        - Secure
        
          - Encrypt/decrypt sensitive values
        
        - Flexible
        
          - Make logical expression to derive values
        
        - Powerful
        
          - Add custom functions in Python
          - Link name data from Python
        
        TODO
        ~~~~
        
        - [X] Setup basic necessity
        
          - [X] Stop procrastinating
          - [X] Project registration in pypi
          - [X] Create unit tests
          - [X] Setup travis
          - [X] Setup coveralls
        
        - [ ] Add more support on Python versions
        
          - [ ] 2.7
          - [ ] 2.8
          - [ ] 3.0
          - [ ] 3.1
          - [ ] 3.2
          - [ ] 3.3
          - [ ] 3.4
          - [ ] 3.5
          - [X] 3.6
        
        - [ ] Features
        
          - [ ] Test on multilanguage
          - [ ] Add better exception handling
          - [ ] Add circular dependencies error
          - [ ] Ensure this is good on production environment
        
        - [ ] Improve docs
        
          - [ ] Make github layout code into two left -> right
          - [ ] Put more examples
          - [ ] Setup readthedocs
        
        Install
        ~~~~~~~
        
        .. code:: bash
        
           [sudo] pip install conff
        
        Basic Usage
        ~~~~~~~~~~~
        
        To get very basic parsing:
        
        .. code:: python
        
           import conff
           r = conff.parse({'math': '1 + 3'})
           r = {'math': '4'}
        
        load YAML file
        ^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           r = conff.load('path_of_file.yaml')
        
        import files
        ^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           ## y1.yml
           # shared_conf: 1
           ## y2.yml
           # conf: F.inc('y1.yml')
        
           r = conff.load('y2.yml')
           r = {'conf': {'shared_conf': 1}}
        
        Examples
        ~~~~~~~~
        
        More advances examples:
        
        Parse with simple expression
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           r = conff.parse('1 + 2')
           r = 3
        
        Parse object
        ^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           r = conff.parse({"math": "1 + 2"})
           r = {'math': 3}
        
        Ignore expression (declare it as string)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           r = conff.parse('"1 + 2"')
           r = '1 + 2'
        
        Parse error behaviours
        ^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           errors = []
           r = conff.parse({"math": "1 / 0"}, errors=errors)
           r = {'math': '1 / 0'}
           errors = [['1 / 0', ZeroDivisionError('division by zero',)]]
        
        Parse with functions
        ^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           def fn_add(a, b):
               return a + b
           r = conff.parse('F.add(1, 2)', fns={'add': fn_add})
           r = 3
        
        Parse with names
        ^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           r = conff.parse('a + b', names={'a': 1, 'b': 2})
           r = 3
        
        Parse with extends
        ^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           data = {
               't1': {'a': 'a'},
               't2': {
                   'F.extend': 'R.t1',
                   'b': 'b'
               }
           }
           r = conff.parse(data)
           r = {'t1': {'a': 'a'}, 't2': {'a': 'a', 'b': 'b'}}
        
        Parse with updates
        ^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           data = {
               't1': {'a': 'a'},
               't2': {
                   'b': 'b',
                   'F.update': {
                       'c': 'c'
                   },
               }
           }
           r = conff.parse(data)
           r = {'t1': {'a': 'a'}, 't2': {'b': 'b', 'c': 'c'}}
        
        Parse with extends and updates
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        .. code:: python
        
           import conff
           data = {
               't1': {'a': 'a'},
               't2': {
                   'F.extend': 'R.t1',
                   'b': 'b',
                   'F.update': {
                       'a': 'A',
                       'c': 'c'
                   },
               }
           }
           r = conff.parse(data)
           r = {'t1': {'a': 'a'}, 't2': {'a': 'A', 'b': 'b', 'c': 'c'}}
        
        Test
        ~~~~
        
        To test this project:
        
        .. code:: bash
        
           nose2
        
        Other Open Source
        ~~~~~~~~~~~~~~~~~
        
        This project uses other awesome projects:
        
        - `munch <https://github.com/Infinidat/munch>`_
        - `simpleeval <https://github.com/danthedeckie/simpleeval>`_
        - `cryptography <https://github.com/pyca/cryptography>`_
        
Keywords: config,parser,expression,parse,eval
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python
Requires-Python: >=3.6
