Declarative api to describe fields with server-side validation. Also added basic web server to handle jsons by implementing reference api. Web api also has redis support. Implemented as homework task in OTUS python dev course. Main purpose to practice descriptors as fields in django style and inheritance stuff.
python-mscoring_api.apiThere are two flagsFlag -p, --port to specify port for web server and -l, --log for log file path.
To work with clients_interests method you should start redis server with some content
Desriptor fields will only work with python 3.6+. For previous version one should use metaclass to handle descriptor names:
classNamedDescrMeta(type): def__init__(cls, name, bases, attrs): super().__init__(name, bases, attrs) forattr_name, attr_valinattrs: ifisinstance(attr_val, Field): attr_val.__set_name__(cls, attr_name)
or support name to field via constructor
python-munittesttests/integration/test_*.pyto run integration tests
python-munittesttests/unit/test_*.pyto run unit tests