typepy is a Python library for variable type checking, validation, and conversion at runtime. As of version 1.3.4, it supports Python 3.9 and newer. It maintains an active release cadence, with several minor updates per year addressing compatibility, new Python versions, and bug fixes.
pip install typepyVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to use the `typepy.Type` class for generic type handling and conversion, including providing default values for `None`. It also shows the usage of specific type classes like `typepy.String` and `typepy.Integer` for more focused operations and how to handle potential conversion errors.
Upgrade your Python interpreter to version 3.9 or a later compatible version.
Replace all instances of `typepy.Binary` with `typepy.Bytes`.
Upgrade your Python interpreter to version 3.7 or a later compatible version (preferably 3.9+ for current versions).
Use `Type(...).try_get(Type.TARGET_TYPE, default_value=...)` when you want to gracefully handle conversion failures with a fallback. Use `Type(...).convert()` (or specific type class `.convert()`) when you expect strict conversion or want to catch and handle specific conversion errors.
No dependency data recorded yet.