Skip to main content

🌍 GeoLocation API

A simple API to retrieve timezone, locale, and geolocation data from an IP address. Perfect for enriching your application with accurate location-based accept-language and timezone details.


📦 Installation

Install the package using pip:

pip install latlongtimezone-api

🚀 Usage

Here's how to get started with the GeoLocation class:

from geolocation import GeoLocation

# Initialize the GeoLocation class with a proxy (if needed)
geo = GeoLocation(proxy="http://user:pass@host:port")

# Fetch geolocation data
geolocation_data = geo.get_geolocation()

# Print the geolocation data
print(geolocation_data)

# Returns the following dictionary:
{
    "lat": 48.8566,
    "lon": 2.3522,
    "timezone": "Europe/Paris",
    "locale": "fr-FR",
    "ip": "82.117.11.11"
}

🛠️ Features

  • Fetch public IP address
  • Retrieve latitude, longitude, timezone, and locale
  • Cache results using Redis for faster subsequent lookups

📋 Requirements

To use this package, you'll need:

  • Python 3.6+
  • requests library
  • redis library
  • python-dotenv library

Install the necessary dependencies with:

pip install requests redis python-dotenv

🔧 Configuration

Set up your Redis and proxy configurations in a .env file:

REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=yourpassword

🌟 Contributing

Contributions are welcome! If you have suggestions or improvements, feel free to:

  1. Open an issue to discuss the changes.
  2. Submit a pull request with your enhancements.

👤 Author

dormic97 - GitHub Profile


📝 License

This project is licensed under the MIT License. See the LICENSE file for details.


Happy coding! 🎉


This version includes improved formatting, readability, and a clear flow for anyone using the API.

Download files

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

Source Distribution

latlongtimezone_api-0.1.91.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

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

latlongtimezone_api-0.1.91-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file latlongtimezone_api-0.1.91.tar.gz.

File metadata

  • Download URL: latlongtimezone_api-0.1.91.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for latlongtimezone_api-0.1.91.tar.gz
Algorithm Hash digest
SHA256 0c13e1268b9b7b75d2281c82ad78460169565c6ab6759982ef6119274caf2eb3
MD5 26536e5ce59aff78c3aabb9144f53805
BLAKE2b-256 01c3666c7216f76621c1b943471af82786d1fc7f821820e31bb9e5aaace2cd0e

See more details on using hashes here.

File details

Details for the file latlongtimezone_api-0.1.91-py3-none-any.whl.

File metadata

File hashes

Hashes for latlongtimezone_api-0.1.91-py3-none-any.whl
Algorithm Hash digest
SHA256 826057aeefbab9cd08a7a9cfeee65889445e8196206c01e5f90a16ae419dabf1
MD5 1269367c24335f5d06fb14e1ce233cca
BLAKE2b-256 de8ab629a3ab7a7b120f468b7982bce99dd0dea19e5ba1d8022a4909e0d1b209

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.91 This release

2 files

0.1.8

2 files

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

2 files

Supported by

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