Metadata-Version: 2.1
Name: contractpy
Version: 0.1.2
Summary: A tiny library for validating our data if its adhere the contract.
Home-page: https://github.com/KumarManoj-S/contractpy
Author: Manoj Kumar S
Author-email: kumarmanoj1158@gmail.com
License: MIT
Download-URL: https://github.com/KumarManoj-S/contractpy/archive/0.1.2.tar.gz
Description: # contractpy
        
        contractpy is a tiny library for validating our data if it conforms to the contract that's specified.
        
        # Basic usage
        
        You could simply create a contract object and you could validate your data against the contract.
        ```
        from pycontract import contract, Types
        
        my_contract = {
            'name': Types.STRING,
            'id': Types:INTEGER
        }
        contract = Contract(my_contract)
        
        assert contract.verify({'name': 'Captain America': 'id': 12345}) is True
        ```
        Yes it is as simple as this.
        
        It works for complicated data as well. Like a json that contains a list of strings or list of dictionaries. Please check out the other examples,
        
        ## Other examples
        
        ```
        my_contract = {
            'name': Types.STRING,
            'id': Types:INTEGER,
            'orders': [
                {
                    'orderId': Types:INTEGER,
                    'price': Types:FLOAT,
                }
            ],
            comments: [Types.String]
        }
        
        data = {
            'name': 'Hazel Grace',
            'id: 57331,
            'orders': [
                {
                    'orderId': 1,
                    'price': 420.45
                },
                {
                    'orderId': 2,
                    'price': 750.38
                }
            ],
            comments: ["I really liked the product!", "I am completely satisfied."]
        }
        
        assert Contract(my_contract).verify(data) is True
        ```
Keywords: contract,contract testing,template,validate
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Description-Content-Type: text/markdown
