types-tzlocal
Typing stubs for tzlocal
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- 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 · maintenance · safety
Apache-2.0 license (permissive) — Licensed under Apache-2.0 (permissive), imposing no significant restrictions on use or redistribution in most projects.
last release 2023-10-24 (1025 days) · last repo commit 2026-08-14 · 5,108 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,448,155 downloads/mo, #3,060 on PyPI
Alternatives
Verify before relying
pip install types-tzlocal
# Then use with mypy or pyright to type-check code importing tzlocal
import tzlocal
tz = tzlocal.get_localzone()- 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.
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 on this page. Verify before relying on it.
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
types-tzlocal on PyPI
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.
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.
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()
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 the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetypes-pytz |
| Maintenance | Actively maintained 1,025 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,448,155 / month, #3,060 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Typing :: Stubs Only |
Evidence: types_tzlocal-5.1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “type stubs tzlocal”
- types-tzlocalProvides type stubs for the tzlocal package, enabling static type…
- tzlocalReturns the IANA timezone name and tzinfo object for the local system…
- types-assertpyProvides type stubs enabling static type checkers like mypy and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also types-Pillow · types-DateTimeRange · types-caldav · types-futures · types-babel · types-emoji · types-redis · types-chardet · types-termcolor · types-python-slugify