Skip to main content

World Time Wrapper

This package provides an easy interface with the World Time API site.

To install:

python3 -m pip install world-time-api

This requires the requests module if you don't already have it installed.

Usage

To start, create a client for one of the endpoints (currently they only offer 'ip' and 'timezone' endpoints). The below example returns the time in New York.

from WorldTimeAPI import services as serv

myclient = serv.client('timezone')
requests = {"area":"America","location":"New_York"}

# Returns a DateTimeJSON object
response = myclient.get(**requests)

print(response.datetime)

To get a list of regions and locations:

# Returns ListJSON : NOTE: this is only valid for the 'timezone' endpoint
regions = myclient.regions()
print(regions.data)

Metadata

Release files for world-time-api 2020.5.31

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

Source distribution (sdist)

Source distribution for world-time-api 2020.5.31
File Size Uploaded
world-time-api-2020.5.31.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for world-time-api 2020.5.31
File Interpreter ABI Platform
world_time_api-2020.5.31-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / world-time-api-2020.5.31.tar.gz

Download URL world-time-api-2020.5.31.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bf29ad4e14fa35aed9d34998227a23a4c78dcdefcd353afffed62d534e2b63f8
BLAKE2b-256 checksum
How to use checksums
511bf2aee673bd0fdcdb0c7ae4ebf5195738b951b958f2947be545de61a29cc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

Release files / world_time_api-2020.5.31-py3-none-any.whl

Download URL world_time_api-2020.5.31-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60777bdc958366f37261b36c586e70bd483fcb33a9871750c81f1ecbca43d7fc
BLAKE2b-256 checksum
How to use checksums
117261ec3edc8aea9ce7445d0c076f2af2cfca75498c5419faaf358b03954ede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

2020.5.31 This release

2 release files

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