Metadata-Version: 2.1
Name: tzcity
Version: 0.0.2
Summary: Module to translate city names to time zone names
Home-page: https://github.com/ju-sh/tzcity
License: UNKNOWN
Author: Julin S
Author-email: 
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: mypy ; extra == "test"
Requires-Dist: flake8 ; extra == "test"
Requires-Dist: pylint ; extra == "test"
Requires-Dist: vulture ; extra == "test"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: coverage ; extra == "test"
Requires-Dist: tox ; extra == "test"
Project-URL: Changelog, https://github.com/ju-sh/tzcity/blob/master/CHANGELOG.md
Project-URL: Issue Tracker, https://github.com/ju-sh/tzcity/issues
Provides-Extra: test

# tzcity

<a href="https://pypi.org/ju-sh/tzcity"><img alt="PyPI" src="https://img.shields.io/pypi/v/tzcity"></a>
<img alt="Build Status" src="https://api.travis-ci.com/ju-sh/tzcity.svg?branch=master"></img>
<a href="https://github.com/ju-sh/tzcity/blob/master/LICENSE"><img alt="License: MIT" src="https://img.shields.io/pypi/l/tzcity"></a>

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.

<h2>Installation</h2>

You need Python>=3.6 to use tzcity.

It can be installed from PyPI with pip using

    pip install tzcity

<h2>Usage</h2>

> ##### `tzcity.tzcity(city: str) -> str`

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

Raises `ValueError` 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 `ValueError` 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"

