python-warlock-help-1.3.3-1.oe2203 >  A bg~K$f 5}SA9J'r[(/bM/r "|XV] й+tPV3zdT9Etk3f ExEPz%ꠣ[ %-#eBvy>φ#h0FNuAwli/IVua~C\!,o\=+4 7 'nfF^m9ԙ^%L8Vl:D)yMOcYC1+66e524d94c82ed48d77ffccf8d1a0d5632cef42c1ba145ae4d79119671f8a73c94531425970f97c623348125ff729495402c964abg~K$f?)G6CߊDer`b\8lfZ& eC7%;NلXKko{Ȗco{@S=2)̏ʡ {=͂6HyH Q4\) #ނ/p< $? d % T    5 A d j t x  z  |              W( s8 |9 : F G H I X Y \ ] ^ b 'c d ze f l t u v z     Cpython-warlock-help1.3.31.oe2203Development documents and examples for warlock [![PyPI](https://img.shields.io/pypi/v/warlock.svg)][warlock] [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/warlock.svg)][warlock] [![PyPI - Downloads](https://img.shields.io/pypi/dw/warlock.svg)][pypistats] [![Build Status](https://travis-ci.org/bcwaldon/warlock.svg?branch=master)][ci-builds] [![Coverage Status](https://coveralls.io/repos/github/bcwaldon/warlock/badge.svg?branch=master)][coveralls] Warlock is [available on PyPI][warlock]: ```shell pip install warlock ``` 1) Create your schema ```python >>> schema = { 'name': 'Country', 'properties': { 'name': {'type': 'string'}, 'abbreviation': {'type': 'string'}, 'population': {'type': 'integer'}, }, 'additionalProperties': False, } ``` 2) Create a model ```python >>> import warlock >>> Country = warlock.model_factory(schema) ``` 3) Create an object using your model ```python >>> sweden = Country(name='Sweden', abbreviation='SE') ``` 4) Let the object validate itself ```python >>> sweden.name = 5 Traceback (most recent call last): File "", line 1, in File "warlock/core.py", line 53, in __setattr__ raise InvalidOperation(msg) warlock.core.InvalidOperation: Unable to set 'name' to '5' >>> sweden.overlord = 'Bears' Traceback (most recent call last): File "", line 1, in File "warlock/core.py", line 53, in __setattr__ raise InvalidOperation(msg) warlock.core.InvalidOperation: Unable to set 'overlord' to 'Bears' ``` 5) Generate a [JSON Patch document](http://tools.ietf.org/html/draft-ietf-appsawg-json-patch) to track changes ```python >>> sweden.population=9453000 >>> sweden.patch '[{"path": "/population", "value": 9453000, "op": "add"}]' ``` [warlock]: https://pypi.org/project/warlock/ [pip]: https://pip.pypa.io/en/stable/ [ci-builds]: https://travis-ci.org/bcwaldon/warlock [coveralls]: https://coveralls.io/github/bcwaldon/warlock?branch=master [pypistats]: https://pypistats.org/packages/warlockbgfoerv-obs-worker-09openEuler:22.03:Epol / openEuler_22.03_Epolhttp://openeuler.orgApache-2.0http://openeuler.orgUnspecifiedhttp://github.com/bcwaldon/warlocklinuxnoarchAbglrootrootpython-warlock-1.3.3-1.oe2203.src.rpmpython-warlock-helppython3-warlock-doc    rpmlib(CompressedFileNames)rpmlib(FileDigests)rpmlib(PayloadFilesHavePrefix)rpmlib(PayloadIsXz)3.0.4-14.6.0-14.0-15.2-14.15.1_@Python_Bot - Package Spec generatedoerv-obs-worker-09 16509612541.3.3-1.oe2203python-warlock/usr/share/doc/-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/generic-hardened-cc1 -fasynchronous-unwind-tables -fstack-clash-protectionobs://private/openEuler:22.03:Epol/openEuler_22.03_Epol/39acb3a4c37955a6f822f155611004ee-python-warlockcpioxz2noarch-openEuler-linux-gnudirectory/eMRb|+utf-8fe24e16bf687ed44ddbf84a197de6765676a7950e291f7528460bda49eb1f056?@7zXZ !#, Z] b2u jӫ`(y-mK5p Nު