This catalog summarizes the reusable value-object surface by category. Common primitive validators are exported from
value_object_pattern.usables; specialized validators live under their domain packages.
For deeper category references, use:
- Primitive Value Objects
- Date And Time Value Objects
- Identifier Value Objects
- Internet Value Objects
- Money Value Objects
| Model | Purpose |
|---|---|
ValueObject[T] |
Immutable validated wrapper for one value. |
EnumerationValueObject[E] |
Enum-backed value object accepting enum members or raw enum values. |
UnionValueObject[T] |
Value object constrained by a union annotation; supports named subclasses and inline construction. |
BaseModel |
Aggregate-like model with primitive conversion and public-state representation. |
ListValueObject[T] |
Typed immutable list wrapper; supports named subclasses and inline construction. |
DictValueObject[K, V] |
Typed immutable dictionary wrapper; supports named subclasses and inline construction. |
| Area | Examples |
|---|---|
| Strings | StringValueObject, NotEmptyStringValueObject, TrimmedStringValueObject, SecretStringValueObject |
| String formats | lower/upper case, snake case, kebab case, camel case, pascal case, alpha, alphanumeric, digit |
| Integers | integer, positive, positive-or-zero, negative, negative-or-zero, even, odd |
| Floats | float, positive, positive-or-zero, negative, negative-or-zero |
| Booleans | boolean, true, false |
| Bytes and none | bytes, none, not-none |
Import examples:
from value_object_pattern.usables import NotEmptyStringValueObject, PositiveIntegerValueObjectSee Primitive Value Objects for the complete primitive family.
Reusable date/time validators include:
DateValueObjectDatetimeValueObjectStringDateValueObjectStringDatetimeValueObjectTimezoneValueObjectStringTimezoneValueObject
Import examples:
from value_object_pattern.usables.dates import DateValueObject, StringTimezoneValueObjectSee Date And Time Value Objects for conversion and comparison notes.
Identifier validators cover:
- UUID objects and UUID strings for supported UUID versions.
- World identifiers such as ISO 3166 alpha-2, alpha-3, numeric codes, phone codes, country TLDs, and VIN values.
- Spanish identifiers such as DNI, NIE, NIF, NUSS, passport, phone numbers, and vehicle plates.
Import examples:
from value_object_pattern.usables.identifiers.uuid import StringUuidV4ValueObject, UuidV4ValueObject
from value_object_pattern.usables.identifiers.world import Iso3166Alpha2CodeValueObjectSee Identifier Value Objects for UUID, world, Spanish, and vehicle-plate validators.
Internet validators cover:
| Area | Examples |
|---|---|
| URLs and hosts | UrlValueObject, HttpUrlValueObject, HttpsUrlValueObject, HostValueObject, DomainValueObject |
| Addresses and networks | IPv4, IPv6, IP address, IPv4 network, IPv6 network |
| Network metadata | MAC address formats, ports, AWS cloud regions, user agents |
| Keys and slugs | snake-case keys, kebab-case keys, slugs |
| Contact-like values | email addresses, IMEI values |
Import examples:
from value_object_pattern.usables.internet import DomainValueObject, EmailAddressValueObject
from value_object_pattern.usables.internet.uri import UrlValueObjectSee Internet Value Objects for URL, host, address, key, and network boundaries.
Money validators include:
IbanValueObjectCreditCardValueObject- Brand-specific credit card value objects for supported brands.
Import examples:
from value_object_pattern.usables.money import CreditCardValueObject, IbanValueObjectSee Money Value Objects for IBAN and credit-card validation notes.
- Use reusable validators for common primitive and format rules.
- Use domain packages for specialized identifiers, internet, and money validators.
- Use
SecretStringValueObjectonly for display redaction, not secret storage. - Create custom value objects for domain-specific rules that are not generic reusable validators.