Skip to main content

tzcity

PyPI Build Status License: MIT

A module to find the Olson database time zone names of some of the most populous cities in the world without an internet connection.

Only a few cities associated with each time zone are recognized to minimize the size of data bundled with the package.

Installation

You need Python>=3.6 to use tzcity.

It can be installed from PyPI with pip using

pip install tzcity

Usage

tzcity.tzcity(city: str) -> str

Accepts a city name and returns the time zone name associated with that city.

Raises UnknownTZCityException if unable to recognize city.

>>> tzcity.tzcity('abu dhabi')
'Asia/Dubai'

>>> tzcity.tzcity('bandar seri begawan')
'Asia/Brunei'

>>> tzcity.tzcity('myanmar')  # a country with only one time zone
'Asia/Yangon'

tzcity.capitalize(name: str) -> str

Capitalize the city or time zone name provided as argument.

Raises UnknownTZCityException if unable to recognize name.

>>> tzcity.capitalize('andorra la vella')
'Andorra la Vella'

>>> tzcity.capitalize("new york")
'New York'

>>> tzcity.capitalize("dumont d'urville")
"Dumont d'Urville"

Metadata

Release files for tzcity 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tzcity 0.0.3
File Size Uploaded Provenance Actions
tzcity-0.0.3.tar.gz 11.1 kB Without provenance Details for tzcity-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tzcity 0.0.3
File Interpreter ABI Platform Actions
tzcity-0.0.3-py3-none-any.whl Python 3 none any Details for tzcity-0.0.3-py3-none-any.whl

Total release size: 19.9 kB

Release files / tzcity-0.0.3.tar.gz

Download URL tzcity-0.0.3.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5a085e6724a1edd7859e7780a6f3f65967c50e6badec06fd99956e3f06b5d168
BLAKE2b-256 checksum
How to use checksums
e6bc8ddef8d41749285c89957ef73b88d208a470bd3a5cb81a42eb0d7043dd8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.24.0

Release files / tzcity-0.0.3-py3-none-any.whl

Download URL tzcity-0.0.3-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
318d1703c045d4b1a736bc97ae207b37bb8bc391327b712c936b3fc2fe261019
BLAKE2b-256 checksum
How to use checksums
b0da262a8ba49552af936228c6086bb32770cd1f884932d483e1f68ad58f7cb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.24.0

Security for tzcity 0.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page