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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| world-time-api-2020.5.31.tar.gz | 3.3 kB | Without provenance | Details for world-time-api-2020.5.31.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| world_time_api-2020.5.31-py3-none-any.whl | Python 3 | none | any | Details for world_time_api-2020.5.31-py3-none-any.whl |
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
|
Security for world-time-api 2020.5.31
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.