Skip to content

Commit b3648ab

Browse files
committed
update readme and exports
1 parent dea42e0 commit b3648ab

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

README.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ A collection of Value Objects to save time by generalizing types and format vali
1818
* [Numeric value-objects](#numeric-value-objects)
1919
* [Int](#int)
2020
* [Nullable Int](#nullable-int)
21+
* [Positive Int](#positive-int)
22+
* [Nullable Positive Int](#positive-int)
23+
* [Positive or zero Int](#positive-or-zero-int)
24+
* [Nullable Positive or zero Int](#nullable-positive-or-zero-int)
25+
* [Negative Int](#negative-int)
26+
* [Nullable Negative Int](#nullable-negative-int)
27+
* [Negative or zero Int](#negative-or-zero-int)
28+
* [Nullable Negative or zero Int](#nullable-negative-or-zero-int)
2129
* [String value-objects](#string-value-objects)
2230
* [String](#string)
2331
* [Nullable String](#nullable-string)
@@ -70,6 +78,118 @@ my_integer.value() # returns -> 9
7078
my_nullable_integer.value() # returns -> None
7179
```
7280

81+
### Positive Int
82+
83+
```python
84+
from pyvalueobjects import PositiveInt
85+
86+
# Creation
87+
my_integer = PositiveInt(9)
88+
89+
# Getting raw value
90+
my_integer.value() # returns -> 9
91+
```
92+
93+
### Nullable Positive Int
94+
95+
```python
96+
from pyvalueobjects import NullablePositiveInt
97+
98+
# Creation
99+
my_integer = NullablePositiveInt(9)
100+
101+
# Creating from None
102+
my_nullable_integer = NullablePositiveInt(None)
103+
104+
# Getting raw value
105+
my_integer.value() # returns -> 9
106+
my_nullable_integer.value() # returns -> None
107+
```
108+
109+
### Positive Or Zero Int
110+
111+
```python
112+
from pyvalueobjects import PositiveOrZeroInt
113+
114+
# Creation
115+
my_integer = PositiveOrZeroInt(9)
116+
117+
# Getting raw value
118+
my_integer.value() # returns -> 9
119+
```
120+
121+
### Nullable Positive Or Zero Int
122+
123+
```python
124+
from pyvalueobjects import NullablePositiveOrZeroInt
125+
126+
# Creation
127+
my_integer = NullablePositiveOrZeroInt(9)
128+
129+
# Creating from None
130+
my_nullable_integer = NullablePositiveOrZeroInt(None)
131+
132+
# Getting raw value
133+
my_integer.value() # returns -> 9
134+
my_nullable_integer.value() # returns -> None
135+
```
136+
137+
### Negative Int
138+
139+
```python
140+
from pyvalueobjects import NegativeInt
141+
142+
# Creation
143+
my_integer = NegativeInt(-9)
144+
145+
# Getting raw value
146+
my_integer.value() # returns -> -9
147+
```
148+
149+
### Nullable Negative Int
150+
151+
```python
152+
from pyvalueobjects import NullableNegativeInt
153+
154+
# Creation
155+
my_integer = NullableNegativeInt(-9)
156+
157+
# Creating from None
158+
my_nullable_integer = NullableNegativeInt(None)
159+
160+
# Getting raw value
161+
my_integer.value() # returns -> -9
162+
my_nullable_integer.value() # returns -> None
163+
```
164+
165+
### Negative Or Zero Int
166+
167+
```python
168+
from pyvalueobjects import NegativeOrZeroInt
169+
170+
# Creation
171+
my_integer = NegativeOrZeroInt(-9)
172+
173+
# Getting raw value
174+
my_integer.value() # returns -> -9
175+
```
176+
177+
### Nullable Negative Or Zero Int
178+
179+
```python
180+
from pyvalueobjects import NullableNegativeOrZeroInt
181+
182+
# Creation
183+
my_integer = NullableNegativeOrZeroInt(-9)
184+
185+
# Creating from None
186+
my_nullable_integer = NullableNegativeOrZeroInt(None)
187+
188+
# Getting raw value
189+
my_integer.value() # returns -> -9
190+
my_nullable_integer.value() # returns -> None
191+
```
192+
73193
## String value-objects
74194

75195
### String

pyvalueobjects/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pyvalueobjects.numbers.nullable_negative_or_zero_int import NullableNegativeOrZeroInt
1818
from pyvalueobjects.numbers.nullable_positive_or_zero_int import NullablePositiveOrZeroInt
1919
from pyvalueobjects.numbers.positive_int import PositiveInt
20+
from pyvalueobjects.numbers.nullable_positive_int import NullablePositiveInt
2021
from pyvalueobjects.numbers.positive_or_zero_int import PositiveOrZeroInt
2122

2223
# -----------------------------

0 commit comments

Comments
 (0)