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.1a0.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.1a0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geolocaltime-0.1a0.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.1a0.tar.gz
Algorithm Hash digest
SHA256 b1289518019a5132f56823c240866cf184e48e7ec23dcedc2f87a9c7e2098af2
MD5 afdfdb6c51a24ddecc3719b576454438
BLAKE2b-256 ec039fb7e9c6e746db8a8a84d8ae716f9972a13a0d8271ec51269648dc80deec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: geolocaltime-0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 546d0d282ac8a6bbdaba3cbc19216fb28755c6c62ed6cd7687ff011ac53b6c63
MD5 58c1d0c844f19e2b5b0095e1b71a12d2
BLAKE2b-256 348e2213e73a739e946bb75939fd1b27f8d320423365482226eaf9b6209d164f

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