Python Value-Objects
![](https://raw.githubusercontent.com/jparadadev/python-value-objects/assets/assets/logo.png)
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
my_integer = Int(9)
my_integer.value()
Nullable Int
Integer numbers and None.
from pyvalueobjects import NullableInt
my_integer = NullableInt(9)
my_nullable_integer = NullableInt(None)
my_integer.value()
my_nullable_integer.value()
Positive Int
from pyvalueobjects import PositiveInt
my_integer = PositiveInt(9)
my_integer.value()
Nullable Positive Int
from pyvalueobjects import NullablePositiveInt
my_integer = NullablePositiveInt(9)
my_nullable_integer = NullablePositiveInt(None)
my_integer.value()
my_nullable_integer.value()
Positive Or Zero Int
from pyvalueobjects import PositiveOrZeroInt
my_integer = PositiveOrZeroInt(9)
my_integer.value()
Nullable Positive Or Zero Int
from pyvalueobjects import NullablePositiveOrZeroInt
my_integer = NullablePositiveOrZeroInt(9)
my_nullable_integer = NullablePositiveOrZeroInt(None)
my_integer.value()
my_nullable_integer.value()
Negative Int
from pyvalueobjects import NegativeInt
my_integer = NegativeInt(-9)
my_integer.value()
Nullable Negative Int
from pyvalueobjects import NullableNegativeInt
my_integer = NullableNegativeInt(-9)
my_nullable_integer = NullableNegativeInt(None)
my_integer.value()
my_nullable_integer.value()
Negative Or Zero Int
from pyvalueobjects import NegativeOrZeroInt
my_integer = NegativeOrZeroInt(-9)
my_integer.value()
Nullable Negative Or Zero Int
from pyvalueobjects import NullableNegativeOrZeroInt
my_integer = NullableNegativeOrZeroInt(-9)
my_nullable_integer = NullableNegativeOrZeroInt(None)
my_integer.value()
my_nullable_integer.value()
String value-objects
String
from pyvalueobjects import String
my_str = String('potato')
my_str.value()
Nullable String
from pyvalueobjects import NullableString
my_str = NullableString('potato')
my_str.value()
my_nullable_str = NullableString(None)
my_nullable_str.value()
Non Empty String
from pyvalueobjects import NonEmptyString
my_str = NonEmptyString('potato')
my_str.value()
my_str2 = NonEmptyString('')
Nullable non Empty String
from pyvalueobjects import NullableNonEmptyString
my_str = NullableNonEmptyString('potato')
my_str.value()
my_str2 = NullableNonEmptyString(None)
my_str2.value()
my_str3 = NullableNonEmptyString('')
Uuid4
from pyvalueobjects import Uuid4
my_uuid4 = Uuid4('6c7add12-bf35-459e-a6c5-3178a2a33011')
my_uuid4.value()
Nullable Uuid4
from pyvalueobjects import NullableUuid4
my_uuid4 = NullableUuid4('6c7add12-bf35-459e-a6c5-3178a2a33011')
my_null_uuid4 = NullableUuid4(None)
my_uuid4.value()
my_null_uuid4.value()
Date value-objects
ISO Date
from pyvalueobjects import IsoDate
my_date = IsoDate('2023-08-15T04:55:12.076Z')
my_date.value()
Data structures value-objects
ArrayList
from pyvalueobjects import ArrayList
from pyvalueobjects import Int
my_int_array = ArrayList(Int)([39])
my_int_array.value()
Nullable ArrayList
from pyvalueobjects import ArrayList
from pyvalueobjects import Int
my_int_array = ArrayList(Int)([39])
my_null_array = ArrayList(Int)(None)
my_int_array.value()
my_null_array.value()
Security value-objects
CVE
from pyvalueobjects import Cve
my_cve = Cve('CVE-2014-9418')
my_cve.value()
Nullable CVE
from pyvalueobjects import NullableCve
my_cve = NullableCve('CVE-2014-9418')
my_null_cve = NullableCve(None)
my_cve.value()
my_null_cve.value()
CPE
from pyvalueobjects import Cpe
my_cpe = Cpe('cpe:/a:openjdk:openjdk:8u282')
my_cpe.value()
Nullable CPE
from pyvalueobjects import NullableCpe
my_cpe = NullableCpe('cpe:/a:openjdk:openjdk:8u282')
my_null_cpe = NullableCpe(None)
my_cpe.value()
my_null_cpe.value()