Skip to main content

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

  1. Clone the Repository:

    git clone https://github.com/testinapps/open-weather-flask.git
    cd open-weather-flask
    
  2. Set Up a Virtual Environment (optional but recommended):

    python -m venv venv
    # Activate the virtual environment:
    source venv/bin/activate
    
  3. Install Dependencies:

    pip install .
    
  4. Configure the API Key:

    • Obtain a free API key from OpenWeatherMap.
    • Set the OPENWEATHER_API_KEY environment variable with your API key:
      export OPENWEATHER_API_KEY=your_api_key_here
      

Usage

  1. Run the Application:

    python -m weather_fetcher
    
  2. Access the API:

    • Use tools like curl or 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.

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


Download files

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

Source Distribution

open_weather_flask-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

open_weather_flask-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file open_weather_flask-0.1.1.tar.gz.

File metadata

  • Download URL: open_weather_flask-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for open_weather_flask-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4f2e269d66b1cefaac0dcd5ba91ce8f92f17e2b82f5d86177e79ea599c9eeddf
MD5 4a77de1076ccf11b54b1070f9786a22e
BLAKE2b-256 60c2c723d1264f2371d2636586c547bf54d6ebd8a46e72e4082cead9f70de816

See more details on using hashes here.

File details

Details for the file open_weather_flask-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for open_weather_flask-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ed854c275bbe86da04fdc00ffcbe4e42784f5a278eaacb34b75773c1f18a59
MD5 25127e79a3f4fde8a925ab6aa3320875
BLAKE2b-256 2d952b1cd60aa512b5ff025e3e1ea9c4e591ad727d811e0fcc18acdbcb00fd0e

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