Skip to main content

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.

Metadata

Release files for weatherscraper 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weatherscraper 1.1
File Size Uploaded
weatherscraper-1.1.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for weatherscraper 1.1
File Interpreter ABI Platform
weatherscraper-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / weatherscraper-1.1.tar.gz

Download URL weatherscraper-1.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9211a7392dfbf296920e4e21149cc469bcf1bba63543f3b9f93ae9182a188f9c
BLAKE2b-256 checksum
How to use checksums
9c01e3de84aa12746ac5f8aa5ef57e7958370a400171776a270edebd9c1689ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / weatherscraper-1.1-py3-none-any.whl

Download URL weatherscraper-1.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9db8c9bf712adb3c0942eebd1f48db399765da6d7dc2ef8dd56bb05767d3ec18
BLAKE2b-256 checksum
How to use checksums
68dd74c9b636ed05d969d50b10785a834be85b62808a3e13dcb588f41683bae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page