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
- Clone this repository to your local machine:
git clone https://github.com/Unknownuserfrommars/weatherscraper.git
- Install the required dependencies:
pip install -r requirements.txt
Or: Install the Python Package
- 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9211a7392dfbf296920e4e21149cc469bcf1bba63543f3b9f93ae9182a188f9c
|
|
| MD5 |
e0b1c757889d3b5661269c7d7fbf1472
|
|
| BLAKE2b-256 |
9c01e3de84aa12746ac5f8aa5ef57e7958370a400171776a270edebd9c1689ea
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db8c9bf712adb3c0942eebd1f48db399765da6d7dc2ef8dd56bb05767d3ec18
|
|
| MD5 |
131c1d225d14af14a0e42619f3e9f0c6
|
|
| BLAKE2b-256 |
68dd74c9b636ed05d969d50b10785a834be85b62808a3e13dcb588f41683bae7
|