A Python Flask API to fetch weather data
Project description
Open Weather Flask
Open Weather Flask is a Python-based application that retrieves and displays real-time weather information for specified locations. It provides an API that fetches current weather data using the OpenWeatherMap API.
Features
- Fetches real-time weather data for any specified location.
- Provides a RESTful API for programmatic access to weather information.
Requirements
- Python 3.6 or higher
- OpenWeatherMap API key
Installation
-
Clone the Repository:
git clone https://github.com/testinapps/open-weather-flask.git cd open-weather-flask
-
Set Up a Virtual Environment (optional but recommended):
python -m venv venv # Activate the virtual environment: source venv/bin/activate
-
Install Dependencies:
pip install .
-
Configure the API Key:
- Obtain a free API key from OpenWeatherMap.
- Set the
OPENWEATHER_API_KEYenvironment variable with your API key:export OPENWEATHER_API_KEY=your_api_key_here
Usage
-
Run the Application:
python -m weather_fetcher
-
Access the API:
- Use tools like
curlor Postman to interact with the API. - Example:
curl "http://127.0.0.1:5000/weather?location=New York"
- The API will return JSON with current weather data for the specified location.
- Use tools like
Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_weather_flask-0.1.0.tar.gz.
File metadata
- Download URL: open_weather_flask-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54ab54ada50fa586c2a02acc56eb609260e7b9796681ff39434f308aefac3ed4
|
|
| MD5 |
00ed5899df4b293d9abd5cd109b0e06c
|
|
| BLAKE2b-256 |
700852e20d9c6f931393ee7e7cb3e8d721fa64f5cf40947a43096457c7d8d3a3
|
File details
Details for the file open_weather_flask-0.1.0-py3-none-any.whl.
File metadata
- Download URL: open_weather_flask-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce28ba272e6319967fb3734789f1fc1af5cd7a5cf544ee6dff0b443a0896b74b
|
|
| MD5 |
2f6e5542f7a64596f3751d4fa8ebd8eb
|
|
| BLAKE2b-256 |
ab2645ee7e9ef84b2a88777d4b1a587e01319649ddfcfc85ad605460d33769db
|