omnipy.shared.protocols.content
| CLASS | DESCRIPTION |
|---|---|
IsBoolContent |
|
IsBytesContent |
|
IsDictContent |
|
IsDictOfConcatenableItemSequenceLike |
|
IsDictOfDictsContent |
|
IsDictOfListsContent |
|
IsFloatContent |
|
IsIntContent |
|
IsListContent |
|
IsListOfDictsContent |
|
IsListOfListsContent |
|
IsPairTupleContent |
Protocol for paired-type tuples as Model content, e.g. |
IsSameTypeTupleContent |
Protocol for single-type tuples as Model content, e.g. |
IsSetContent |
|
IsStrContent |
|
IsBoolContent
Bases: IsBool, Protocol
| METHOD | DESCRIPTION |
|---|---|
as_integer_ratio |
|
bit_count |
|
bit_length |
|
conjugate |
|
from_bytes |
|
is_integer |
|
to_bytes |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
denominator |
TYPE:
|
imag |
TYPE:
|
numerator |
TYPE:
|
real |
TYPE:
|
Source code in src/omnipy/shared/protocols/content.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
as_integer_ratio
Source code in src/omnipy/shared/protocols/builtins.py
bit_count
Source code in src/omnipy/shared/protocols/builtins.py
bit_length
Source code in src/omnipy/shared/protocols/builtins.py
conjugate
Source code in src/omnipy/shared/protocols/builtins.py
from_bytes
classmethod
is_integer
Source code in src/omnipy/shared/protocols/builtins.py
IsBytesContent
Bases: IsBytes, Protocol
Source code in src/omnipy/shared/protocols/content.py
capitalize
Source code in src/omnipy/shared/protocols/builtins.py
center
Source code in src/omnipy/shared/protocols/builtins.py
count
decode
Source code in src/omnipy/shared/protocols/builtins.py
endswith
expandtabs
Source code in src/omnipy/shared/protocols/builtins.py
find
fromhex
classmethod
hex
Source code in src/omnipy/shared/protocols/builtins.py
index
isalnum
Source code in src/omnipy/shared/protocols/builtins.py
isalpha
Source code in src/omnipy/shared/protocols/builtins.py
isascii
Source code in src/omnipy/shared/protocols/builtins.py
isdigit
Source code in src/omnipy/shared/protocols/builtins.py
islower
Source code in src/omnipy/shared/protocols/builtins.py
isspace
Source code in src/omnipy/shared/protocols/builtins.py
istitle
Source code in src/omnipy/shared/protocols/builtins.py
isupper
Source code in src/omnipy/shared/protocols/builtins.py
join
Source code in src/omnipy/shared/protocols/builtins.py
ljust
Source code in src/omnipy/shared/protocols/builtins.py
lower
Source code in src/omnipy/shared/protocols/builtins.py
lstrip
Source code in src/omnipy/shared/protocols/builtins.py
maketrans
staticmethod
partition
Source code in src/omnipy/shared/protocols/builtins.py
removeprefix
Source code in src/omnipy/shared/protocols/builtins.py
removesuffix
Source code in src/omnipy/shared/protocols/builtins.py
replace
Source code in src/omnipy/shared/protocols/builtins.py
rfind
rindex
rjust
Source code in src/omnipy/shared/protocols/builtins.py
rpartition
Source code in src/omnipy/shared/protocols/builtins.py
rsplit
Source code in src/omnipy/shared/protocols/builtins.py
rstrip
Source code in src/omnipy/shared/protocols/builtins.py
split
Source code in src/omnipy/shared/protocols/builtins.py
splitlines
Source code in src/omnipy/shared/protocols/builtins.py
startswith
strip
Source code in src/omnipy/shared/protocols/builtins.py
swapcase
Source code in src/omnipy/shared/protocols/builtins.py
title
Source code in src/omnipy/shared/protocols/builtins.py
translate
Source code in src/omnipy/shared/protocols/builtins.py
upper
Source code in src/omnipy/shared/protocols/builtins.py
zfill
Source code in src/omnipy/shared/protocols/builtins.py
IsDictContent
Bases: IsDict[_KeyT, _ValT], Protocol[_KeyT, _ValT]
| METHOD | DESCRIPTION |
|---|---|
clear |
D.clear() -> None. Remove all items from D. |
fromkeys |
|
get |
|
items |
|
keys |
|
pop |
|
popitem |
D.popitem() -> (k, v), remove and return some (key, value) pair |
setdefault |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D |
update |
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. |
values |
|
Source code in src/omnipy/shared/protocols/content.py
clear
fromkeys
classmethod
get
Source code in src/omnipy/shared/protocols/builtins.py
items
Source code in src/omnipy/shared/protocols/builtins.py
keys
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
popitem
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update(
m: SupportsKeysAndGetItem[_KT, _VT]
| SupportsKeysAndGetItem[str, _VT]
| Iterable[tuple[_KT, _VT]]
| Iterable[tuple[str, _VT]]
| None = None,
/,
**kwargs: _VT,
) -> None
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
Source code in src/omnipy/shared/protocols/typing.py
values
Source code in src/omnipy/shared/protocols/builtins.py
IsDictOfConcatenableItemSequenceLike
Bases: IsDictContent[str, _ConcatColumnModelT | IsItemSequenceLike[_ValT] | Generator[_ValT, None, None]], Protocol[_ConcatColumnModelT, _ValT]
| METHOD | DESCRIPTION |
|---|---|
clear |
D.clear() -> None. Remove all items from D. |
fromkeys |
|
get |
|
items |
|
keys |
|
pop |
|
popitem |
D.popitem() -> (k, v), remove and return some (key, value) pair |
setdefault |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D |
update |
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. |
values |
|
Source code in src/omnipy/shared/protocols/content.py
clear
fromkeys
classmethod
get
Source code in src/omnipy/shared/protocols/builtins.py
items
Source code in src/omnipy/shared/protocols/builtins.py
keys
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
popitem
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update(
m: SupportsKeysAndGetItem[_KT, _VT]
| SupportsKeysAndGetItem[str, _VT]
| Iterable[tuple[_KT, _VT]]
| Iterable[tuple[str, _VT]]
| None = None,
/,
**kwargs: _VT,
) -> None
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
Source code in src/omnipy/shared/protocols/typing.py
values
Source code in src/omnipy/shared/protocols/builtins.py
IsDictOfDictsContent
Bases: IsDictContent[_KeyT, _ValMappingT | SupportsKeysAndGetItem[_NestedKeyT, _NestedValT] | Iterable[tuple[_NestedKeyT, _NestedValT]]], Protocol[_KeyT, _ValMappingT, _NestedKeyT, _NestedValT]
| METHOD | DESCRIPTION |
|---|---|
clear |
D.clear() -> None. Remove all items from D. |
fromkeys |
|
get |
|
items |
|
keys |
|
pop |
|
popitem |
D.popitem() -> (k, v), remove and return some (key, value) pair |
setdefault |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D |
update |
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. |
values |
|
Source code in src/omnipy/shared/protocols/content.py
clear
fromkeys
classmethod
get
Source code in src/omnipy/shared/protocols/builtins.py
items
Source code in src/omnipy/shared/protocols/builtins.py
keys
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
popitem
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update(
m: SupportsKeysAndGetItem[_KT, _VT]
| SupportsKeysAndGetItem[str, _VT]
| Iterable[tuple[_KT, _VT]]
| Iterable[tuple[str, _VT]]
| None = None,
/,
**kwargs: _VT,
) -> None
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
Source code in src/omnipy/shared/protocols/typing.py
values
Source code in src/omnipy/shared/protocols/builtins.py
IsDictOfListsContent
Bases: IsDictContent[_KeyT, _ValSeqOrGenT | IsItemSequenceLike[_NestedValT] | Generator[_NestedValT]], Protocol[_KeyT, _ValSeqOrGenT, _NestedValT]
| METHOD | DESCRIPTION |
|---|---|
clear |
D.clear() -> None. Remove all items from D. |
fromkeys |
|
get |
|
items |
|
keys |
|
pop |
|
popitem |
D.popitem() -> (k, v), remove and return some (key, value) pair |
setdefault |
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D |
update |
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. |
values |
|
Source code in src/omnipy/shared/protocols/content.py
clear
fromkeys
classmethod
get
Source code in src/omnipy/shared/protocols/builtins.py
items
Source code in src/omnipy/shared/protocols/builtins.py
keys
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
popitem
D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update
update(
m: SupportsKeysAndGetItem[_KT, _VT]
| SupportsKeysAndGetItem[str, _VT]
| Iterable[tuple[_KT, _VT]]
| Iterable[tuple[str, _VT]]
| None = None,
/,
**kwargs: _VT,
) -> None
D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
Source code in src/omnipy/shared/protocols/typing.py
values
Source code in src/omnipy/shared/protocols/builtins.py
IsFloatContent
Bases: IsFloat, Protocol
| METHOD | DESCRIPTION |
|---|---|
as_integer_ratio |
|
conjugate |
|
from_number |
|
fromhex |
|
hex |
|
is_integer |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
imag |
TYPE:
|
real |
TYPE:
|
Source code in src/omnipy/shared/protocols/content.py
as_integer_ratio
Source code in src/omnipy/shared/protocols/builtins.py
conjugate
Source code in src/omnipy/shared/protocols/builtins.py
from_number
classmethod
fromhex
classmethod
hex
Source code in src/omnipy/shared/protocols/builtins.py
is_integer
Source code in src/omnipy/shared/protocols/builtins.py
IsIntContent
Bases: IsInt, Protocol
| METHOD | DESCRIPTION |
|---|---|
as_integer_ratio |
|
bit_count |
|
bit_length |
|
conjugate |
|
from_bytes |
|
is_integer |
|
to_bytes |
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
denominator |
TYPE:
|
imag |
TYPE:
|
numerator |
TYPE:
|
real |
TYPE:
|
Source code in src/omnipy/shared/protocols/content.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
as_integer_ratio
Source code in src/omnipy/shared/protocols/builtins.py
bit_count
Source code in src/omnipy/shared/protocols/builtins.py
bit_length
Source code in src/omnipy/shared/protocols/builtins.py
conjugate
Source code in src/omnipy/shared/protocols/builtins.py
from_bytes
classmethod
is_integer
Source code in src/omnipy/shared/protocols/builtins.py
IsListContent
Bases: IsList[_ValT], Protocol[_ValT]
| METHOD | DESCRIPTION |
|---|---|
append |
|
clear |
S.clear() -> None -- remove all items from S |
count |
|
extend |
|
index |
|
insert |
|
pop |
|
remove |
|
reverse |
S.reverse() -- reverse IN PLACE |
sort |
|
Source code in src/omnipy/shared/protocols/content.py
append
Source code in src/omnipy/shared/protocols/builtins.py
clear
count
Source code in src/omnipy/shared/protocols/builtins.py
extend
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
insert
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
remove
Source code in src/omnipy/shared/protocols/builtins.py
reverse
sort
Source code in src/omnipy/shared/protocols/builtins.py
IsListOfDictsContent
Bases: IsListContent[_ValMappingT | SupportsKeysAndGetItem[_NestedKeyT, _NestedValT] | Iterable[tuple[_NestedKeyT, _NestedValT]]], Protocol[_ValMappingT, _NestedKeyT, _NestedValT]
| METHOD | DESCRIPTION |
|---|---|
append |
|
clear |
S.clear() -> None -- remove all items from S |
count |
|
extend |
|
index |
|
insert |
|
pop |
|
remove |
|
reverse |
S.reverse() -- reverse IN PLACE |
sort |
|
Source code in src/omnipy/shared/protocols/content.py
append
Source code in src/omnipy/shared/protocols/builtins.py
clear
count
Source code in src/omnipy/shared/protocols/builtins.py
extend
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
insert
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
remove
Source code in src/omnipy/shared/protocols/builtins.py
reverse
sort
Source code in src/omnipy/shared/protocols/builtins.py
IsListOfListsContent
Bases: IsListContent[_ValSeqOrGenT | IsItemSequence[_NestedValT] | Generator[_NestedValT]], Protocol[_ValSeqOrGenT, _NestedValT]
| METHOD | DESCRIPTION |
|---|---|
append |
|
clear |
S.clear() -> None -- remove all items from S |
count |
|
extend |
|
index |
|
insert |
|
pop |
|
remove |
|
reverse |
S.reverse() -- reverse IN PLACE |
sort |
|
Source code in src/omnipy/shared/protocols/content.py
append
Source code in src/omnipy/shared/protocols/builtins.py
clear
count
Source code in src/omnipy/shared/protocols/builtins.py
extend
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
insert
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/builtins.py
remove
Source code in src/omnipy/shared/protocols/builtins.py
reverse
sort
Source code in src/omnipy/shared/protocols/builtins.py
IsPairTupleContent
Bases: IsHashable, IsTuple[_ValT | _SecondValT], Protocol[_ValT, _SecondValT]
Protocol for paired-type tuples as Model content, e.g. Model[tuple[int, str]]
IsPairTupleContent is a protocol with the same interface as the builtin class
tuple, with exactly two elements (e.g. tuple[int, str]). As it is meant
to annotate Omnipy Models for static typing, it does not support +
and * operators (other than for empty tuples and multiplying by 1),
as these operations would cause validation to fail.
| METHOD | DESCRIPTION |
|---|---|
count |
|
index |
|
Source code in src/omnipy/shared/protocols/content.py
count
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
IsSameTypeTupleContent
Bases: IsHashable, IsTuple[_ValT], Protocol[_ValT]
Protocol for single-type tuples as Model content, e.g. Model[tuple[int, ...]]
IsSameTypeTupleContent has the same interface as the builtin class
tuple, but where all elements of the same type (e.g. tuple[int,
...]). As it is meant to annotate Omnipy Models for static typing, it
supports broader interoperability with other iterables of the same
element type.
| METHOD | DESCRIPTION |
|---|---|
count |
|
index |
|
Source code in src/omnipy/shared/protocols/content.py
count
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
IsSetContent
Bases: IsSet[_ValT], Protocol[_ValT]
Source code in src/omnipy/shared/protocols/content.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
add
Source code in src/omnipy/shared/protocols/builtins.py
clear
Source code in src/omnipy/shared/protocols/typing.py
difference
difference_update
discard
Source code in src/omnipy/shared/protocols/builtins.py
intersection
intersection_update
isdisjoint
Source code in src/omnipy/shared/protocols/builtins.py
issubset
Source code in src/omnipy/shared/protocols/builtins.py
issuperset
Source code in src/omnipy/shared/protocols/builtins.py
pop
Source code in src/omnipy/shared/protocols/typing.py
remove
Source code in src/omnipy/shared/protocols/builtins.py
symmetric_difference
symmetric_difference_update
Source code in src/omnipy/shared/protocols/builtins.py
union
update
Source code in src/omnipy/shared/protocols/builtins.py
IsStrContent
Bases: IsStr, Protocol
Source code in src/omnipy/shared/protocols/content.py
capitalize
Source code in src/omnipy/shared/protocols/builtins.py
casefold
Source code in src/omnipy/shared/protocols/builtins.py
center
Source code in src/omnipy/shared/protocols/builtins.py
count
Source code in src/omnipy/shared/protocols/builtins.py
encode
Source code in src/omnipy/shared/protocols/builtins.py
endswith
expandtabs
Source code in src/omnipy/shared/protocols/builtins.py
find
Source code in src/omnipy/shared/protocols/builtins.py
format
Source code in src/omnipy/shared/protocols/builtins.py
format_map
Source code in src/omnipy/shared/protocols/builtins.py
index
Source code in src/omnipy/shared/protocols/builtins.py
isalnum
Source code in src/omnipy/shared/protocols/builtins.py
isalpha
Source code in src/omnipy/shared/protocols/builtins.py
isascii
Source code in src/omnipy/shared/protocols/builtins.py
isdecimal
Source code in src/omnipy/shared/protocols/builtins.py
isdigit
Source code in src/omnipy/shared/protocols/builtins.py
isidentifier
Source code in src/omnipy/shared/protocols/builtins.py
islower
Source code in src/omnipy/shared/protocols/builtins.py
isnumeric
Source code in src/omnipy/shared/protocols/builtins.py
isprintable
Source code in src/omnipy/shared/protocols/builtins.py
isspace
Source code in src/omnipy/shared/protocols/builtins.py
istitle
Source code in src/omnipy/shared/protocols/builtins.py
isupper
Source code in src/omnipy/shared/protocols/builtins.py
join
Source code in src/omnipy/shared/protocols/builtins.py
ljust
Source code in src/omnipy/shared/protocols/builtins.py
lower
Source code in src/omnipy/shared/protocols/builtins.py
lstrip
Source code in src/omnipy/shared/protocols/builtins.py
maketrans
staticmethod
maketrans(
x: dict[int, _T" optional hover>_T]
| dict[str, _T" optional hover>_T]
| dict[str | int, _T]
| frozendict[int, _T]
| frozendict[str, _T]
| frozendict[str | int, _T],
) -> dict[int, _T]
partition
partition(
sep: str | LiteralString,
) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
removeprefix
Source code in src/omnipy/shared/protocols/builtins.py
removesuffix
Source code in src/omnipy/shared/protocols/builtins.py
replace
replace(
old: str | LiteralString, new: str | LiteralString, count: SupportsIndex = -1
) -> Self | LiteralString
Source code in src/omnipy/shared/protocols/builtins.py
rfind
Source code in src/omnipy/shared/protocols/builtins.py
rindex
Source code in src/omnipy/shared/protocols/builtins.py
rjust
Source code in src/omnipy/shared/protocols/builtins.py
rpartition
rpartition(
sep: str | LiteralString,
) -> tuple[Self, Self, Self] | tuple[LiteralString, LiteralString, LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
rsplit
rsplit(
sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1
) -> list[Self] | list[LiteralString]
Source code in src/omnipy/shared/protocols/builtins.py
rstrip
Source code in src/omnipy/shared/protocols/builtins.py
split
split(
sep: str | LiteralString | None = None, maxsplit: SupportsIndex = -1
) -> list[Self] | list[LiteralString]