Skip to main content

A module to scrape weather data from weather.com

Project description

Weather Scraping App

A simple Python application that scrapes weather data for various cities around the world. This app retrieves information from Weather.com.

Features

Get current weather data for cities worldwide. Supports both Fahrenheit and Celsius for temperature. Displays additional weather data: description, humidity, and wind speed. (EDITOR'S NOTE: UNSTABLE, WORKING ON HOW TO FIX)

Cities Supported

Los Angeles, USA San Francisco, USA New York, USA London, UK Tokyo, Japan Paris, France Beijing, PRC Sydney, Australia Moscow, Russia Cairo, Egypt Mumbai, India Dubai, UAE Hong Kong, PRC Singapore, Singapore Toronto, Canada S茫o Paulo, Brazil Sao Paulo, Brazil (same as S茫o Paulo) Seoul, ROK (South Korea) Rome, Italy Berlin, Germany Barcelona, Spain Amsterdam, Netherlands Istanbul, Turkey Buenos Aires, Argentina Madrid, Spain Johannesburg, South Africa Bangkok, Thailand Athens, Greece Vienna, Austria Stockholm, Sweden Dublin, Ireland Rio de Janeiro, Brazil Melbourne, Australia Chicago, USA Taipei, PRC

Installation

Using Git

  1. Clone this repository to your local machine:
git clone https://github.com/Unknownuserfrommars/weatherscraper.git
  1. Install the required dependencies:
pip install -r requirements.txt

Or: Install the Python Package

  1. Using pip
python -m pip install weatherscraper

Usage

Import weatherscraper and call the get_weather() function with a city's identifier:

from weatherscraper import get_weather, Cities
# Or run: import weatherscraper as wscrape
weather = get_weather(Cities.Tokyo) # Or: weather = wscrape.get_weather(wscrape.Cities.Beijing)
print(weather)

If you want the temperature in Celsius, pass the celsius=True argument into the get_weather() function (default is False).

Disclaimer

This project uses web scraping to collect weather data from Weather.com. Please ensure that you comply with any applicable robots.txt rules, and use this tool responsibly. The weather data retrieved by this application is not guaranteed to be 100% accurate and should not be used for critical applications.

This project is for educational purposes only. The author is not responsible for any damage or loss resulting from the use of this application.

Weather.com may change its website structure at any time, which could break the functionality of the scraper.

License

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

  • Please Read 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

weatherscraper-1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

weatherscraper-1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file weatherscraper-1.1.tar.gz.

File metadata

  • Download URL: weatherscraper-1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for weatherscraper-1.1.tar.gz
Algorithm Hash digest
SHA256 9211a7392dfbf296920e4e21149cc469bcf1bba63543f3b9f93ae9182a188f9c
MD5 e0b1c757889d3b5661269c7d7fbf1472
BLAKE2b-256 9c01e3de84aa12746ac5f8aa5ef57e7958370a400171776a270edebd9c1689ea

See more details on using hashes here.

File details

Details for the file weatherscraper-1.1-py3-none-any.whl.

File metadata

  • Download URL: weatherscraper-1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for weatherscraper-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9db8c9bf712adb3c0942eebd1f48db399765da6d7dc2ef8dd56bb05767d3ec18
MD5 131c1d225d14af14a0e42619f3e9f0c6
BLAKE2b-256 68dd74c9b636ed05d969d50b10785a834be85b62808a3e13dcb588f41683bae7

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