--- id: types-tzlocal version: "5.1.0.1" license: Apache-2.0 license license_treatment: permissive maintenance: active --- # types-tzlocal — Typing stubs for tzlocal License: permissive · Maintenance: active · Downloads: 2.4M/mo ## What it is and what it does types-tzlocal is a PEP 561 type stub package that supplies type annotations for the tzlocal library. It allows static type checkers (mypy, pyright, pytype, PyCharm) to understand and validate code that calls tzlocal functions, catching type errors before runtime. The stubs are maintained in the typeshed repository and are tested against mypy 1.6.1, pyright 1.1.332, and pytype 2023.10.17. This package is specifically versioned for tzlocal 5.1. However, tzlocal has included its own type annotations since version 5.2, making this stub package unnecessary for newer versions. If you are using tzlocal 5.2 or later, you should uninstall types-tzlocal to avoid conflicts and use the built-in stubs instead. Use it for: - Enable mypy or pyright to type-check a codebase that imports and uses tzlocal for local timezone detection. - Provide IDE autocomplete and type hints for tzlocal functions in PyCharm or other type-aware editors. - Validate timezone-related code in a CI/CD pipeline using static type checking before runtime. - Ensure type safety when calling tzlocal functions in a strictly typed Python project. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides type stubs for the tzlocal package, enabling static type checkers like mypy, pyright, and pytype to validate code that uses tzlocal for timezone operations. Yes, but only if you are locked to tzlocal 5.1 or earlier and need type checking support. If you are using tzlocal 5.2 or later, do not install this package—uninstall it if present—because tzlocal now includes its own type stubs. For tzlocal 5.1 users, this is a straightforward, low-friction addition to enable static type checking. ## Install pip install types-tzlocal uv add types-tzlocal poetry add types-tzlocal ## Installing types-tzlocal Before you install: Low install friction with a single lightweight runtime dependency (types-pytz). The package is actively maintained in the typeshed repository, though tzlocal has included its own type annotations since version 5.2, making this package redundant for newer versions. License in practice: Licensed under Apache-2.0 (permissive), imposing no significant restrictions on use or redistribution in most projects. Quickstart: pip install types-tzlocal # Then use with mypy or pyright to type-check code importing tzlocal import tzlocal tz = tzlocal.get_localzone() Only useful if you are using tzlocal version 5.1 or earlier; tzlocal 5.2+ includes its own type stubs and this package should be uninstalled to avoid conflicts. Verify before relying: - Whether types-pytz is a required runtime dependency or only needed for stub completeness. - Compatibility with type checkers released after pyright 1.1.332 and mypy 1.6.1. - Whether this package remains actively maintained given the note that tzlocal 5.2+ includes built-in stubs. ## Package facts - License: Apache-2.0 license (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type stubs tzlocal, mypy tzlocal typing, pyright timezone stubs, static type checking timezone, PEP 561 type stubs, tzlocal type annotations, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-tzlocal) · [View on PyPI](https://pypi.org/project/types-tzlocal/)