Skip to main content

A collection of Value Objects to save time by generalizing data type and format validations.

Project description

Python Value-Objects

GitHub Pypi Downloads GA

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

Uuid4

from pyvalueobjects import Uuid4

# Creation
my_uuid4 = Uuid4('6c7add12-bf35-459e-a6c5-3178a2a33011')

# Getting raw value
my_uuid4.value()  # returns -> '6c7add12-bf35-459e-a6c5-3178a2a33011'

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

pyvalueobjects-0.18.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvalueobjects-0.18.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file pyvalueobjects-0.18.1.tar.gz.

File metadata

  • Download URL: pyvalueobjects-0.18.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for pyvalueobjects-0.18.1.tar.gz
Algorithm Hash digest
SHA256 8108baa45f5c3f9efc0b9542a9db17fbf8b384c44863e383f32b2fe51946a0fd
MD5 68808b08e03f0315faf07774bef139f0
BLAKE2b-256 0e155ebf2ebe18e1a28086b5bc009a49a9104b3d878d248cccd96c601d58a496

See more details on using hashes here.

File details

Details for the file pyvalueobjects-0.18.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyvalueobjects-0.18.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd40c14d3fd9820e46fbe37c5028784e5a6c072af087b08cd88bbf2cd968dc95
MD5 6296069cacafaa61c8c7ab8cc157da34
BLAKE2b-256 340cc7d8da72ed9c152e01a489fd02a8867a575dc02c54982707eb4ec9305f42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page