DDD Value Objects implementation
Project description
- Info:
DDD Value Object implementation.
Features
Value object can’t be changed once created
Two objects with the same values are considered equal
Access to values after dot: value.my_value
Access to values like dict: value[‘my_value’]
Installation
pip install vo
Package: https://pypi.org/project/vo/
Documentation
Read full documentation on: http://vo.readthedocs.io
Quick Example
>>> from vo import Value
>>> value = Value(test=True, some_text="I am some text string")
>>> value == value
True
>>> value_clone = Value(some_text="I am some text string", test=True)
>>> value == value_clone
True
>>> value is value_clone
False
>>> value_truth = Value(purpose_of_life=42)
>>> value == value_truth
False
>>> value_truth.purpose_of_life
42
>>> value_truth['purpose_of_life']
42
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vo-0.3.0.tar.gz
(24.0 kB
view hashes)
Built Distribution
vo-0.3.0-py3-none-any.whl
(4.9 kB
view hashes)