{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/17"}],"enrichment":{"capability":"DateType provides type-checking-time wrapper types for Python's standard `datetime` module that enforce stricter type distinctions: preventing `datetime` from type-checking as `date`, and separating naive and aware datetimes into mutually-incompatible types.","skillfed_tags":["type-checking","datetime"],"use_cases":["Enforce type-checker rejection of code that passes a datetime where a date is expected, catching a common source of type errors","Prevent mixing of naive and aware datetimes in the same codebase by making them incompatible at type-check time","Migrate a large codebase to stricter datetime typing without rewriting datetime construction logic","Build libraries that need to document and enforce whether they accept only naive or only aware datetimes"],"what_it_does":"DateType is a type-checking wrapper for Python's `datetime` module designed to address limitations in how the standard library's datetime types interact with static type checkers. The core issue it solves is that `datetime` objects inherit from `date` at runtime but should not be treated as interchangeable with `date` in type-checked code\u2014a distinction that standard type stubs don't enforce. Additionally, it separates naive (timezone-unaware) and aware (timezone-aware) datetimes into distinct, mutually-incompatible types at the type-checking level, preventing accidental mixing of these fundamentally different datetime representations.\n\nThe implementation preserves the runtime behavior of stdlib datetime (instances still inherit as before) while providing separate `Naive` and `Aware` type wrappers and construction methods. It depends only on typing_extensions and supports Python versions from 3.7 through 3.14, making it suitable for projects that need stricter datetime type safety without major runtime overhead or compatibility concerns.","worth_installing":"Yes, if you use a type checker (mypy, pyright) and want stricter datetime type safety. The package is actively maintained, has no known vulnerabilities, and adds minimal friction. It's most valuable in codebases where datetime/date confusion or naive/aware mixing has been a source of bugs. If you don't use static type checking or haven't encountered these issues, it offers no runtime benefit."},"id":"datetype","links":{"html":"https://skillfed.io/packages/datetype","md":"https://skillfed.io/packages/datetype.md","pypi":"https://pypi.org/project/datetype/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-12-01","license_spdx":null,"license_treatment":"unclear","name":"datetype","python_support":"supports_current","summary":"A type wrapper for the standard library `datetime` that supplies stricter checks, such as making 'datetime' not substitutable for 'date', and separating out Naive and Aware datetimes into separate, mutually-incompatible types."},"popularity":{"monthly_downloads":89530,"position":13653,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2025.11.30"}
