Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmfiola/geolocation-util
https://github.com/jmfiola/geolocation-util
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/jmfiola/geolocation-util
- Owner: jmfiola
- License: mit
- Created: 2024-09-10T23:49:40.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-10T23:55:02.000Z (2 months ago)
- Last Synced: 2024-09-11T04:11:43.869Z (2 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jacob's Geolocation Utility Assignment
This utility fetches the latitude, longitude, and place name for given city/state or zip code inputs using the Open Weather Geocoding API. It supports multiple location inputs and returns the first result for each location.
## Features
- Fetches geolocation data (latitude, longitude, place name) for city/state or zip code inputs.
- Supports multiple location inputs in a single run.
- Utilizes the Open Weather Geocoding API for accurate and up-to-date information.## Prerequisites
- Python 3.x installed on your machine.
- An API key from Open Weather Geocoding API. You can obtain one by signing up at [OpenWeatherMap](https://home.openweathermap.org/users/sign_up).## Installation
1. Clone the repository:
```sh
git clone [email protected]:jmfiola/geolocation-util.git
cd geolocation-util
```2. Install the required Python packages using `requirements.txt`
```sh
python -m pip install -r requirements.txt
```## Usage
Run the utility with a list of locations (city, state or zip code) and an API key:
```sh
python geoloc_util.py --api-key YOUR_API_KEY --locations "Madison, WI" "12345" "Chicago, IL" "10001"
```This command will output the geolocation data for the specified locations.
## Testing
Run the integration tests using the following command:
```sh
python -m pytest test_geoloc_util.py --api-key YOUR_API_KEY
```## License
This project is licensed under the MIT License. See the LICENSE file for details.