Skip to content

Commit

Permalink
update readme and exports
Browse files Browse the repository at this point in the history
  • Loading branch information
n1nj4t4nuk1 committed Dec 15, 2023
1 parent dea42e0 commit b3648ab
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
120 changes: 120 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ A collection of Value Objects to save time by generalizing types and format vali
* [Numeric value-objects](#numeric-value-objects)
* [Int](#int)
* [Nullable Int](#nullable-int)
* [Positive Int](#positive-int)
* [Nullable Positive Int](#positive-int)
* [Positive or zero Int](#positive-or-zero-int)
* [Nullable Positive or zero Int](#nullable-positive-or-zero-int)
* [Negative Int](#negative-int)
* [Nullable Negative Int](#nullable-negative-int)
* [Negative or zero Int](#negative-or-zero-int)
* [Nullable Negative or zero Int](#nullable-negative-or-zero-int)
* [String value-objects](#string-value-objects)
* [String](#string)
* [Nullable String](#nullable-string)
Expand Down Expand Up @@ -70,6 +78,118 @@ my_integer.value() # returns -> 9
my_nullable_integer.value() # returns -> None
```

### Positive Int

```python
from pyvalueobjects import PositiveInt

# Creation
my_integer = PositiveInt(9)

# Getting raw value
my_integer.value() # returns -> 9
```

### Nullable Positive Int

```python
from pyvalueobjects import NullablePositiveInt

# Creation
my_integer = NullablePositiveInt(9)

# Creating from None
my_nullable_integer = NullablePositiveInt(None)

# Getting raw value
my_integer.value() # returns -> 9
my_nullable_integer.value() # returns -> None
```

### Positive Or Zero Int

```python
from pyvalueobjects import PositiveOrZeroInt

# Creation
my_integer = PositiveOrZeroInt(9)

# Getting raw value
my_integer.value() # returns -> 9
```

### Nullable Positive Or Zero Int

```python
from pyvalueobjects import NullablePositiveOrZeroInt

# Creation
my_integer = NullablePositiveOrZeroInt(9)

# Creating from None
my_nullable_integer = NullablePositiveOrZeroInt(None)

# Getting raw value
my_integer.value() # returns -> 9
my_nullable_integer.value() # returns -> None
```

### Negative Int

```python
from pyvalueobjects import NegativeInt

# Creation
my_integer = NegativeInt(-9)

# Getting raw value
my_integer.value() # returns -> -9
```

### Nullable Negative Int

```python
from pyvalueobjects import NullableNegativeInt

# Creation
my_integer = NullableNegativeInt(-9)

# Creating from None
my_nullable_integer = NullableNegativeInt(None)

# Getting raw value
my_integer.value() # returns -> -9
my_nullable_integer.value() # returns -> None
```

### Negative Or Zero Int

```python
from pyvalueobjects import NegativeOrZeroInt

# Creation
my_integer = NegativeOrZeroInt(-9)

# Getting raw value
my_integer.value() # returns -> -9
```

### Nullable Negative Or Zero Int

```python
from pyvalueobjects import NullableNegativeOrZeroInt

# Creation
my_integer = NullableNegativeOrZeroInt(-9)

# Creating from None
my_nullable_integer = NullableNegativeOrZeroInt(None)

# Getting raw value
my_integer.value() # returns -> -9
my_nullable_integer.value() # returns -> None
```

## String value-objects

### String
Expand Down
1 change: 1 addition & 0 deletions pyvalueobjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pyvalueobjects.numbers.nullable_negative_or_zero_int import NullableNegativeOrZeroInt
from pyvalueobjects.numbers.nullable_positive_or_zero_int import NullablePositiveOrZeroInt
from pyvalueobjects.numbers.positive_int import PositiveInt
from pyvalueobjects.numbers.nullable_positive_int import NullablePositiveInt
from pyvalueobjects.numbers.positive_or_zero_int import PositiveOrZeroInt

# -----------------------------
Expand Down

0 comments on commit b3648ab

Please sign in to comment.