A collection of Value Objects to save time by generalizing data type and format validations.
Project description
Python Value-Objects
A collection of Value Objects to save time by generalizing types and format validations.
Value-objects
Numeric value-objects
Int
Integer numbers without a fractional component that don't support decimal points.
from pyvalueobjects import Int
# Creation
my_integer = Int(9)
# Getting raw value
my_integer.value() # returns -> 9
Nullable Int
Integer numbers and None.
from pyvalueobjects import NullableInt
# Creation
my_integer = NullableInt(9)
# Creating from None
my_nullable_integer = NullableInt(None)
# Getting raw value
my_integer.value() # returns -> 9
my_nullable_integer.value() # returns -> None
String value-objects
String
from pyvalueobjects import String
# Creation
my_str = String('potato')
# Getting raw value
my_str.value() # returns -> 'potato'
Nullable String
from pyvalueobjects import NullableString
# Creation
my_str = NullableString('potato')
# Getting raw value
my_str.value() # returns -> 'potato'
# Creation
my_nullable_str = NullableString(None)
# Getting raw value
my_nullable_str.value() # returns -> None
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyvalueobjects-0.13.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for pyvalueobjects-0.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2941d015cc679334b78f7c750e756a0aa9832e7484b03e212d1634f5e6f566aa |
|
MD5 | d51bcfb83c6142be3272a3b972786de0 |
|
BLAKE2b-256 | e0f756c4388f2491defbba5e11ad21ba33c7f2a51d25d4f247919aec9e93e4a7 |