Skip to main content

timezonedb.com API [python wrapper]

Project description

timezonedb.com API [python wrapper]

Wrapper for timezonedb.com API

API Reference

Full timezonedb.com API reference can be found here

HOW TO USE

list timezone reference

List out all available time zones supported by TimeZoneDB.

from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.list_time_zone(response_format="json")
print(res)

get timezone reference

Get local time of a city by its name, time zone, latitude & longtiude, or IP address.

from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.get_time_zone(
    response_format="json",
    by="position",
    lat="40.689247",
    lng="-74.044502",
)
print(res)
from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.get_time_zone(
    response_format="json",
    by="city",
    city="chicago",
    country="US",
)
print(res)

convert timezones reference

Convert timestamp between two different time zone.

from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.convert_time_zone(
    response_format="json",
    from_zone="America/Los_Angeles",
    to_zone="Australia/Sydney",
)
print(res)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timezonedb-0.1.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file timezonedb-0.1.tar.gz.

File metadata

  • Download URL: timezonedb-0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

File hashes

Hashes for timezonedb-0.1.tar.gz
Algorithm Hash digest
SHA256 f68d565890dd9b1014c39e4eccd305523af98782f58dc6072f2576ff484c3e95
MD5 3651dd1bc6a53ed534bdf9721d88e129
BLAKE2b-256 f2a4ed06e8f8c3a6d0d8e29e2ea2e1a9afa5a0e7638b6c4815f8f0cf04cd6afa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page