Skip to content

sbaqa/geolocation_program

Repository files navigation

Geolocation Utility

This is a command-line utility to fetch geolocation data (latitude, longitude, and place details) from OpenWeather Geocoding API based on city/state or ZIP code input. Fully specified task for this program development you can find here using a link

Prerequisites

  • Python 3.7+
  • pip package manager

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-folder>
  2. Create and activate a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt

Usage

Run the command with the --locations flag followed by city/state or ZIP codes:

python geolocation_utility.py --locations Madison, WI 10001

Example output:

{"name": "Madison", "lat": 43.0731, "lon": -89.4012, "state": "Wisconsin"}
{"zip": "10001", "lat": 40.7128, "lon": -74.0060, "city": "New York"}

Running Tests

  1. Ensure dependencies are installed (see Installation section).
  2. Run tests from the core project folder using pytest:
    pytest

Notes

  • This utility only supports locations within the United States.
  • It uses the OpenWeather Geocoding API.

License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages