MCPcopy Create free account

hub / github.com/samuelcolvin/dirty-equals / types & classes

Types & classes64 in github.com/samuelcolvin/dirty-equals

↓ 13 callersClassIsStr
Checks if the value is a string, and optionally meets some constraints. `IsStr` is a subclass of [`IsAnyStr`][dirty_equals.IsAnyStr] and the
dirty_equals/_strings.py:121
↓ 12 callersClassIsNow
Check if a datetime is close to now, this is similar to `IsDatetime(approx=datetime.now())`, but slightly more powerful.
dirty_equals/_datetime.py:123
↓ 9 callersClassIsDatetime
Check if the value is a datetime, and matches the given conditions.
dirty_equals/_datetime.py:11
↓ 8 callersClassIsDict
Base class for comparing dictionaries. By default, `IsDict` isn't particularly useful on its own (it behaves pretty much like a normal `dict`
dirty_equals/_dict.py:12
↓ 8 callersClassIsInstance
A type which checks that the value is an instance of the expected type.
dirty_equals/_inspection.py:10
↓ 8 callersClassIsInt
Checks that a value is an integer. Inherits from [`IsNumeric`][dirty_equals.IsNumeric] and can therefore be initialised with any of its argu
dirty_equals/_numeric.py:283
↓ 7 callersClassIsJson
A class that checks if a value is a JSON object, and check the contents of the JSON.
dirty_equals/_other.py:65
↓ 6 callersClassIsList
All the same functionality as [`IsListOrTuple`][dirty_equals.IsListOrTuple], but the compared value must be a list. ```py title="IsList"
dirty_equals/_sequence.py:218
↓ 4 callersClassIsAnyStr
Comparison of `str` or `bytes` objects. This class allow comparison with both `str` and `bytes` but is subclassed by [`IsStr`][dirty_equ
dirty_equals/_strings.py:13
↓ 4 callersClassIsFalseLike
Check if the value is False like. `IsFalseLike` allows comparison to anything and effectively uses `return not bool(other)` (with string chec
dirty_equals/_boolean.py:32
↓ 4 callersClassIsToday
Check if a date is today, this is similar to `IsDate(approx=date.today())`, but slightly more powerful.
dirty_equals/_datetime.py:276
↓ 3 callersClassFoo
tests/test_inspection.py:6
↓ 3 callersClassFunctionCheck
Use a function to check if a value "equals" whatever you want to check
dirty_equals/_other.py:128
↓ 3 callersClassHasName
A type which checks that the value has the given `__name__` attribute.
dirty_equals/_inspection.py:63
↓ 3 callersClassIsBytes
Checks if the value is a bytes object, and optionally meets some constraints. `IsBytes` is a subclass of [`IsAnyStr`][dirty_equals.IsAnyStr]
dirty_equals/_strings.py:142
↓ 3 callersClassIsHash
A class that checks if a value is a valid common hash type, using a simple length and allowed characters regex.
dirty_equals/_other.py:284
↓ 2 callersClassBar
tests/test_inspection.py:27
↓ 2 callersClassDirtyAnd
dirty_equals/_base.py:176
↓ 2 callersClassDirtyNot
dirty_equals/_base.py:188
↓ 2 callersClassDirtyOr
dirty_equals/_base.py:164
↓ 2 callersClassHasRepr
A type which checks that the value has the given `repr()` value.
dirty_equals/_inspection.py:117
↓ 2 callersClassIsDataclass
Checks that an object is an instance of a dataclass. Inherits from [`DirtyEquals`][dirty_equals.DirtyEquals] and it can be initialised with
dirty_equals/_other.py:413
↓ 2 callersClassIsIP
A class that checks if a value is a valid IP address, optionally checking IP version, netmask.
dirty_equals/_other.py:333
↓ 2 callersClassIsIgnoreDict
Dictionary comparison with `None` values ignored, this is the same as [`IsDict(...).settings(ignore={None})`][dirty_equals.IsDict.settings].
dirty_equals/_dict.py:182
↓ 2 callersClassIsPartialDict
Partial dictionary comparison, this is the same as [`IsDict(...).settings(partial=True)`][dirty_equals.IsDict.settings]. ```py title="Is
dirty_equals/_dict.py:159
↓ 2 callersClassIsUUID
A class that checks if a value is a valid UUID, optionally checking UUID version.
dirty_equals/_other.py:20
↓ 2 callersClassIsUrl
A class that checks if a value is a valid URL, optionally checking different URL types and attributes with [Pydantic](https://pydantic-docs.h
dirty_equals/_other.py:176
↓ 1 callersClassAddress
tests/test_other.py:44
↓ 1 callersClassContains
Check that an object contains one or more values.
dirty_equals/_sequence.py:63
↓ 1 callersClassFoo
tests/test_other.py:34
↓ 1 callersClassIsApprox
Simplified subclass of [`IsNumber`][dirty_equals.IsNumber] that only allows approximate comparisons.
dirty_equals/_numeric.py:165
↓ 1 callersClassIsNegative
Check that a value is negative (`< 0`), can be an `int`, a `float` or a `Decimal` (or indeed any value which implements `__lt__` for `0`).
dirty_equals/_numeric.py:211
↓ 1 callersClassIsPositive
Check that a value is positive (`> 0`), can be an `int`, a `float` or a `Decimal` (or indeed any value which implements `__gt__` for `0`).
dirty_equals/_numeric.py:188
↓ 1 callersClassIsStrictDict
Dictionary comparison with order enforced, this is the same as [`IsDict(...).settings(strict=True)`][dirty_equals.IsDict.settings]. ```p
dirty_equals/_dict.py:215
↓ 1 callersClassPerson
tests/test_other.py:50
↓ 1 callersClassPlainRepr
Hack to allow repr of string without quotes.
dirty_equals/_utils.py:6
ClassAnyThing
A type which matches any value. `AnyThing` isn't generally very useful on its own, but can be used within other comparisons. ```py title
dirty_equals/_base.py:207
ClassDirtyEquals
Base type for all *dirty-equals* types.
dirty_equals/_base.py:51
ClassDirtyEqualsMeta
dirty_equals/_base.py:15
ClassFooEnum
tests/test_other.py:27
ClassHasAttributes
A type which checks that the value has the given attributes. This is a partial check - e.g. the attributes provided to check do not need to
dirty_equals/_inspection.py:152
ClassHasLen
Check that some has a given length, or length in a given range.
dirty_equals/_sequence.py:21
ClassIsDataclassType
Checks that an object is a dataclass type. Inherits from [`DirtyEquals`][dirty_equals.DirtyEquals]. ```py title="IsDataclassType" f
dirty_equals/_other.py:387
ClassIsDate
Check if the value is a date, and matches the given conditions.
dirty_equals/_datetime.py:199
ClassIsEnum
Checks if an instance is an Enum. Inherits from [`DirtyEquals`][dirty_equals.DirtyEquals]. ```py title="IsEnum" from enum import En
dirty_equals/_other.py:557
ClassIsFloat
Checks that a value is a float. Inherits from [`IsNumeric`][dirty_equals.IsNumeric] and can therefore be initialised with any of its argumen
dirty_equals/_numeric.py:353
ClassIsFloatInf
Checks that a value is float and infinite (positive or negative). Inherits from [`IsFloat`][dirty_equals.IsFloat]. ```py title="IsFloat
dirty_equals/_numeric.py:419
ClassIsFloatInfNeg
Checks that a value is float and negative infinite. Inherits from [`IsFloatInf`][dirty_equals.IsFloatInf]. ```py title="IsFloatInfNeg"
dirty_equals/_numeric.py:463
ClassIsFloatInfPos
Checks that a value is float and positive infinite. Inherits from [`IsFloatInf`][dirty_equals.IsFloatInf]. ```py title="IsFloatInfPos"
dirty_equals/_numeric.py:439
ClassIsFloatNan
Checks that a value is float and nan (not a number). Inherits from [`IsFloat`][dirty_equals.IsFloat]. ```py title="IsFloatNan" from
dirty_equals/_numeric.py:487
ClassIsListOrTuple
Check that some object is a list or tuple and optionally its values match some constraints.
dirty_equals/_sequence.py:92
ClassIsNegativeFloat
Like [`IsNegative`][dirty_equals.IsNegative] but only for `float`s. ```py title="IsNegativeFloat" from decimal import Decimal from
dirty_equals/_numeric.py:397
ClassIsNegativeInt
Like [`IsNegative`][dirty_equals.IsNegative] but only for `int`s. ```py title="IsNegativeInt" from decimal import Decimal from dirt
dirty_equals/_numeric.py:331
ClassIsNonNegative
Check that a value is positive or zero (`>= 0`), can be an `int`, a `float` or a `Decimal` (or indeed any value which implements `__ge__` for
dirty_equals/_numeric.py:234
ClassIsNonPositive
Check that a value is negative or zero (`<=0`), can be an `int`, a `float` or a `Decimal` (or indeed any value which implements `__le__` for
dirty_equals/_numeric.py:258
ClassIsNumber
Base class for all types that can be used with all number types, e.g. numeric but not `date` or `datetime`. Inherits from [`IsNumeric`][dirt
dirty_equals/_numeric.py:149
ClassIsNumeric
Base class for all numeric types, `IsNumeric` implements approximate and inequality comparisons, as well as the type checks. This class
dirty_equals/_numeric.py:30
ClassIsOneOf
A type which checks that the value is equal to one of the given values. Can be useful with boolean operators.
dirty_equals/_base.py:229
ClassIsPartialDataclass
Inherits from [`IsDataclass`][dirty_equals.IsDataclass] with `partial=True` by default. ```py title="IsPartialDataclass" from dataclasse
dirty_equals/_other.py:496
ClassIsPositiveFloat
Like [`IsPositive`][dirty_equals.IsPositive] but only for `float`s. ```py title="IsPositiveFloat" from decimal import Decimal from
dirty_equals/_numeric.py:375
ClassIsPositiveInt
Like [`IsPositive`][dirty_equals.IsPositive] but only for `int`s. ```py title="IsPositiveInt" from decimal import Decimal from dirt
dirty_equals/_numeric.py:309
ClassIsStrictDataclass
Inherits from [`IsDataclass`][dirty_equals.IsDataclass] with `strict=True` by default. ```py title="IsStrictDataclass" from dataclasses
dirty_equals/_other.py:524
ClassIsTrueLike
Check if the value is True like. `IsTrueLike` allows comparison to anything and effectively uses just `return bool(other)`. Example of b
dirty_equals/_boolean.py:7
ClassIsTuple
All the same functionality as [`IsListOrTuple`][dirty_equals.IsListOrTuple], but the compared value must be a tuple. ```py title="IsTuple"
dirty_equals/_sequence.py:239