Skip to main content

Accurately enriches location data with local time and time-of-day insights.

Project description

geolocaltime-py

Accurately enriches location data with local time and time-of-day insights.

This modern Python module represents an idiomatic client accessing the Geolocaltime location services being hosted on Rapid API Hub.

Features

The geolocaltime API provides three main endpoints for geospatial time intelligence:

🌍 /enrich - Location Time Enrichment

Enriches locations with current local date and time values using standardized time zones. The local date and time value for each location are determined at the time of execution.

🔄 /convert - UTC to Local Time Conversion

Converts date and time values from UTC to local time for specified locations using WGS84 coordinate system.

🕐 /timeofday - Time of Day Classification

Classifies local time values into meaningful time-of-day categories like "last night", "morning", "noon", "afternoon", "evening" and "night". The classifier uses seasonal locations of the sun and moon for realistic classifications.

Key Capabilities

  • Batch Processing: All endpoints support batch processing of up to 100 coordinates per request
  • Automatic Chunking: Library automatically handles >100 coordinates by chunking requests
  • WGS84 Compatibility: Uses WGS84 spatial reference system for precision and global compatibility
  • Comprehensive Validation: Validates coordinate bounds and input consistency
  • Error Handling: Robust error handling with descriptive messages

Installation

pip install geolocaltime

Quick Start

from georapid.client import GeoRapidClient
from georapid.factory import EnvironmentClientFactory
from geolocaltime.services import enrich, convert, time_of_day
from geolocaltime.types import OutputType

# Set up client (requires RAPIDAPI_KEY environment variable)
host = 'geolocaltime.p.rapidapi.com'
client: GeoRapidClient = EnvironmentClientFactory.create_client_with_host(host)

# Define coordinates
latitudes = [50.0088, 39.437, 66.0557]
longitudes = [8.2756, -31.542, -23.7033]
utc_times = ['2024-10-19T09:18:42.542819'] * 3

# Enrich locations with current local time
enriched = enrich(client, latitudes, longitudes, OutputType.LOCAL)

# Convert UTC times to local times
converted = convert(client, latitudes, longitudes, utc_times, OutputType.LOCAL)

# Classify time of day
local_times = ['2025-06-09T21:58:01.010457+01:00', '2025-06-09T19:58:01.010457-01:00', '2025-06-09T20:58:01.010457+00:00']
time_classifications = time_of_day(client, latitudes, longitudes, local_times)

Documentation

For detailed documentation, visit geolocaltime.readthedocs.io.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

geolocaltime-0.1.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geolocaltime-0.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geolocaltime-0.1.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.15

File hashes

Hashes for geolocaltime-0.1.tar.gz
Algorithm Hash digest
SHA256 88d4de7465c140b54eace8b92875a3a5707ca4ee449940c966a6b3389fa10887
MD5 7639db05f4ad1a26ba483dc6397a5203
BLAKE2b-256 689815d61b5bbdb099d54aa425a8c9ad5efd9548b8007cea3611cca21eb5d45e

See more details on using hashes here.

File details

Details for the file geolocaltime-0.1-py3-none-any.whl.

File metadata

  • Download URL: geolocaltime-0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.15

File hashes

Hashes for geolocaltime-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db36ba011868274160572d47fa03f6ac2e483933f267b10659aa929c24262bbd
MD5 509eb24329377b9b63da63218461f8ef
BLAKE2b-256 815767e4990f8169e5bc3a5b03012f6760fe3d8c7a5fb2ee84cf241b839b0ff0

See more details on using hashes here.

Supported by

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