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'
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.12.0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for pyvalueobjects-0.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc17d126a371e12031ff4117570a6befa518ba09d879cd3a6d38e6ad515e46b8 |
|
MD5 | a994b4304601080d8a01b241a269b98d |
|
BLAKE2b-256 | 54329414cfb7dcd658007dcbd0c64d24bf418a7c14d0e295a53007089f70780a |