Weatherpy-1


NameWeatherpy-1 JSON
Version 0.4 PyPI version JSON
download
home_pageNone
SummaryPython Wrapper For Weather API
upload_time2024-08-05 16:08:15
maintainerNone
docs_urlNone
authorDeep Shah
requires_pythonNone
licenseNone
keywords python weather weather api weather forecast weatherpy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# WeatherPy - A python Wrapper for Weather 



WeatherPy is a simple Python module for fetching current weather conditions and future weather forecasts using the WeatherAPI. It abstracts the complexity of dealing with the API and provides straightforward functions for retrieving weather data by just providing the city name.



## Features



- Get current weather information, including temperature, weather condition, and wind speed.

- Fetch a 5-day weather forecast, including daily maximum and minimum temperatures and weather conditions.



## Installation



To install WeatherPy, you need to have Python installed on your machine. Install the required dependency by running:



```bash

pip install Weatherpy-1

```



## Usage



### Import the Module



Import the functions from the `weatherpy` module to get started.



```python

from WeatherPy.weather_utils import GetWeather, FutureForecast

```



### Get Current Weather



Use the `GetWeather` function to retrieve the current weather for a specific city.



#### Example



```python

from WeatherPy.weather_utils import GetWeather



city = "London"

current_weather = GetWeather(city)



if isinstance(current_weather, dict):

    print(f"Temperature: {current_weather['temprature_c']}°C")

    print(f"Condition: {current_weather['condition']}")

    print(f"Wind Speed: {current_weather['wind']} kph")

else:

    print(current_weather)

```



#### Output



```

Temperature: 15°C

Condition: Partly cloudy

Wind Speed: 12 kph

```



### Get Future Forecast



Use the `FutureForecast` function to get a 5-day weather forecast for a given city.



#### Example



```python

from WeatherPy.weather_utils import FutureForecast



city = "London"

forecast = FutureForecast(city)



if isinstance(forecast, list):

    for day in forecast:

        print(f"Date: {day['date']}")

        print(f"Max Temp: {day['max_temp']}°C")

        print(f"Min Temp: {day['min_temp']}°C")

        print(f"Condition: {day['condition']}")

        print()

else:

    print(forecast)

```



#### Output



```

Date: 2024-08-05

Max Temp: 22°C

Min Temp: 15°C

Condition: Sunny



Date: 2024-08-06

Max Temp: 23°C

Min Temp: 16°C

Condition: Cloudy

```



## API Key Management



WeatherPy handles the API key internally. Users only need to provide the city name as a parameter to the functions.



## License



This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.



## Contributing



If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are welcome.



1. Fork the repository.

2. Create your feature branch (`git checkout -b feature/YourFeature`).

3. Commit your changes (`git commit -am 'Add some feature'`).

4. Push to the branch (`git push origin feature/YourFeature`).

5. Create a new Pull Request.



## Acknowledgements



- [WeatherAPI](https://www.weatherapi.com/) for providing weather data.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Weatherpy-1",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, weather, weather api, weather forecast, weatherpy",
    "author": "Deep Shah",
    "author_email": "dpshah2307@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4b/a5/4206c0851a5a1a1e2d9111979dbda36339e718607a5314a4fbc2e2c2b54b/Weatherpy-1-0.4.tar.gz",
    "platform": null,
    "description": "\r\n# WeatherPy - A python Wrapper for Weather \r\n\r\n\r\n\r\nWeatherPy is a simple Python module for fetching current weather conditions and future weather forecasts using the WeatherAPI. It abstracts the complexity of dealing with the API and provides straightforward functions for retrieving weather data by just providing the city name.\r\n\r\n\r\n\r\n## Features\r\n\r\n\r\n\r\n- Get current weather information, including temperature, weather condition, and wind speed.\r\n\r\n- Fetch a 5-day weather forecast, including daily maximum and minimum temperatures and weather conditions.\r\n\r\n\r\n\r\n## Installation\r\n\r\n\r\n\r\nTo install WeatherPy, you need to have Python installed on your machine. Install the required dependency by running:\r\n\r\n\r\n\r\n```bash\r\n\r\npip install Weatherpy-1\r\n\r\n```\r\n\r\n\r\n\r\n## Usage\r\n\r\n\r\n\r\n### Import the Module\r\n\r\n\r\n\r\nImport the functions from the `weatherpy` module to get started.\r\n\r\n\r\n\r\n```python\r\n\r\nfrom WeatherPy.weather_utils import GetWeather, FutureForecast\r\n\r\n```\r\n\r\n\r\n\r\n### Get Current Weather\r\n\r\n\r\n\r\nUse the `GetWeather` function to retrieve the current weather for a specific city.\r\n\r\n\r\n\r\n#### Example\r\n\r\n\r\n\r\n```python\r\n\r\nfrom WeatherPy.weather_utils import GetWeather\r\n\r\n\r\n\r\ncity = \"London\"\r\n\r\ncurrent_weather = GetWeather(city)\r\n\r\n\r\n\r\nif isinstance(current_weather, dict):\r\n\r\n    print(f\"Temperature: {current_weather['temprature_c']}\u00b0C\")\r\n\r\n    print(f\"Condition: {current_weather['condition']}\")\r\n\r\n    print(f\"Wind Speed: {current_weather['wind']} kph\")\r\n\r\nelse:\r\n\r\n    print(current_weather)\r\n\r\n```\r\n\r\n\r\n\r\n#### Output\r\n\r\n\r\n\r\n```\r\n\r\nTemperature: 15\u00b0C\r\n\r\nCondition: Partly cloudy\r\n\r\nWind Speed: 12 kph\r\n\r\n```\r\n\r\n\r\n\r\n### Get Future Forecast\r\n\r\n\r\n\r\nUse the `FutureForecast` function to get a 5-day weather forecast for a given city.\r\n\r\n\r\n\r\n#### Example\r\n\r\n\r\n\r\n```python\r\n\r\nfrom WeatherPy.weather_utils import FutureForecast\r\n\r\n\r\n\r\ncity = \"London\"\r\n\r\nforecast = FutureForecast(city)\r\n\r\n\r\n\r\nif isinstance(forecast, list):\r\n\r\n    for day in forecast:\r\n\r\n        print(f\"Date: {day['date']}\")\r\n\r\n        print(f\"Max Temp: {day['max_temp']}\u00b0C\")\r\n\r\n        print(f\"Min Temp: {day['min_temp']}\u00b0C\")\r\n\r\n        print(f\"Condition: {day['condition']}\")\r\n\r\n        print()\r\n\r\nelse:\r\n\r\n    print(forecast)\r\n\r\n```\r\n\r\n\r\n\r\n#### Output\r\n\r\n\r\n\r\n```\r\n\r\nDate: 2024-08-05\r\n\r\nMax Temp: 22\u00b0C\r\n\r\nMin Temp: 15\u00b0C\r\n\r\nCondition: Sunny\r\n\r\n\r\n\r\nDate: 2024-08-06\r\n\r\nMax Temp: 23\u00b0C\r\n\r\nMin Temp: 16\u00b0C\r\n\r\nCondition: Cloudy\r\n\r\n```\r\n\r\n\r\n\r\n## API Key Management\r\n\r\n\r\n\r\nWeatherPy handles the API key internally. Users only need to provide the city name as a parameter to the functions.\r\n\r\n\r\n\r\n## License\r\n\r\n\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\r\n\r\n\r\n\r\n## Contributing\r\n\r\n\r\n\r\nIf you'd like to contribute, please fork the repository and use a feature branch. Pull requests are welcome.\r\n\r\n\r\n\r\n1. Fork the repository.\r\n\r\n2. Create your feature branch (`git checkout -b feature/YourFeature`).\r\n\r\n3. Commit your changes (`git commit -am 'Add some feature'`).\r\n\r\n4. Push to the branch (`git push origin feature/YourFeature`).\r\n\r\n5. Create a new Pull Request.\r\n\r\n\r\n\r\n## Acknowledgements\r\n\r\n\r\n\r\n- [WeatherAPI](https://www.weatherapi.com/) for providing weather data.\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python Wrapper For Weather API",
    "version": "0.4",
    "project_urls": null,
    "split_keywords": [
        "python",
        " weather",
        " weather api",
        " weather forecast",
        " weatherpy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8683f5e4d6ffa5d236bfbd663dddb4deb68287617208abbe6324cf772f8902a",
                "md5": "bdb8e7c604fbcab192e1fcf48fcdd9db",
                "sha256": "981ea7f73b4bcd4b406242693664c8bbceb61284001e02d22a936cd0cfad400f"
            },
            "downloads": -1,
            "filename": "Weatherpy_1-0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bdb8e7c604fbcab192e1fcf48fcdd9db",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4256,
            "upload_time": "2024-08-05T16:08:14",
            "upload_time_iso_8601": "2024-08-05T16:08:14.172329Z",
            "url": "https://files.pythonhosted.org/packages/e8/68/3f5e4d6ffa5d236bfbd663dddb4deb68287617208abbe6324cf772f8902a/Weatherpy_1-0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ba54206c0851a5a1a1e2d9111979dbda36339e718607a5314a4fbc2e2c2b54b",
                "md5": "62fc692d39daf7e48779b6c89a836a9a",
                "sha256": "217a167b02f581d2bb4af1b6bb1af620589f57e090b6c7bb08affd5291b031e9"
            },
            "downloads": -1,
            "filename": "Weatherpy-1-0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "62fc692d39daf7e48779b6c89a836a9a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4299,
            "upload_time": "2024-08-05T16:08:15",
            "upload_time_iso_8601": "2024-08-05T16:08:15.927972Z",
            "url": "https://files.pythonhosted.org/packages/4b/a5/4206c0851a5a1a1e2d9111979dbda36339e718607a5314a4fbc2e2c2b54b/Weatherpy-1-0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-05 16:08:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "weatherpy-1"
}
        
Elapsed time: 4.17089s