Get the current time of any city in the world.
Project description
tikcity
A simple, robust Python library to get the current local time of any city in the world.
Description
tikcity solves the problem of finding the exact local time for a specific city when you don't know its timezone. It automatically handles:
- Geocoding: Locating the city by name (e.g., "Paris", "New York", "Mumbai").
- Timezone Lookup: Finding the correct timezone for that location.
- Time Formatting: Returning the current wall-clock time with the timezone abbreviation (e.g., EST, IST, CET).
Installation
Install the package via pip:
pip install tikcity
Install the package via uv:
uv add tikcity
Usage
Using the library is straightforward. Import the get_time function and pass the name of any city.
import tikcity
Get time for a major city print(tikcity.get_time("London"))
Output: 2025-12-17 10:30:00 GMT Get time for a specific location print(tikcity.get_time("San Francisco"))
Output: 2025-12-17 02:30:00 PST Handle potential errors (e.g., city not found) print(tikcity.get_time("Atlantis"))
Output: Error: City 'Atlantis' not found.
Features
- Global Coverage: Works with practically any city name recognized by standard geocoding services.
- Timezone Aware: Automatically detects the correct timezone (including Daylight Saving Time adjustments).
- Simple API: No need to handle latitude, longitude, or timezone strings yourself.
Dependencies
This library relies on the following powerful packages:
- geopy - For locating cities.
- timezonefinder - For mapping coordinates to timezones.
- pytz - For accurate timezone calculations.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tikcity-0.0.1.tar.gz.
File metadata
- Download URL: tikcity-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29b5f689e9c570e026484da0d324f9b688f30d39e8a21cff4716ccd33549bae6
|
|
| MD5 |
3e4ce5bef797ef76d3430260c773790a
|
|
| BLAKE2b-256 |
3668122889cdb366c987d97bc17dd3422195148ebb9e30c355c87a917698439c
|
File details
Details for the file tikcity-0.0.1-py3-none-any.whl.
File metadata
- Download URL: tikcity-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a573c67708bff850235a1007c95b8be56161f51aff97e7a30ea1d5be0e6d53f
|
|
| MD5 |
784c7efedb35c60bf41de5960c57c9ae
|
|
| BLAKE2b-256 |
77c7df671156975ba11c670b4f44b121fa217b753cd7b4d7413693bd981441e1
|