The Olson timezone database for Python.
Supports Python 2.7+ and 3.5+.
Installation
pip install pytzdata
Usage
You can access the content of a specific timezone file by using the tz_file() function:
from pytzdata import tz_file
with tz_file('Europe/Paris') as f:
# Do something with the file
If you just want to know the path to a specific timezone file, you may use the tz_path() function:
from pytzdata import tz_path
tz_path('Europe/Paris')
By default, pytzdata will use the bundled timezone database, however you can set a custom directory that holds the timezone files using the set_directory function:
import pytzdata
pytzdata.set_directory('/custom/zoneinfo')
You can also set the PYTZDATA_TZDATADIR environment variable to set a custom directory.
Release
To make a new release just follow these steps:
make data
Update version numbers in pytzdata/version.py and tests/test_version.py
make tox
Resources
Metadata
Release files for pytzdata 2020.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytzdata-2020.1.tar.gz | 281.7 kB | Without provenance | Details for pytzdata-2020.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytzdata-2020.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pytzdata-2020.1-py2.py3-none-any.whl |
Total release size: 771.7 kB
Release files / pytzdata-2020.1.tar.gz
| Download URL | pytzdata-2020.1.tar.gz |
|---|---|
| Size | 281.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3efa13b335a00a8de1d345ae41ec78dd11c9f8807f522d39850f2dd828681540
|
|
BLAKE2b-256 checksum How to use checksums |
67624c25435a7c2f9c7aef6800862d6c227fc4cd81e9f0beebc5549a49c8ed53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.0a3 CPython/3.8.3 Darwin/19.5.0
|
Release files / pytzdata-2020.1-py2.py3-none-any.whl
| Download URL | pytzdata-2020.1-py2.py3-none-any.whl |
|---|---|
| Size | 490.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f
|
|
BLAKE2b-256 checksum How to use checksums |
e04f4474bda990ee740a020cbc3eb271925ef7daa7c8444240d34ff62c8442a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.0a3 CPython/3.8.3 Darwin/19.5.0
|
Security for pytzdata 2020.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.