Skip to main content

UNKNOWN

Project description

The problem: I want to look up the weather from wunderground from my terminal without opening up a web browser. I figured “hey, this should be easy / fun to do using Python!” – WRONG! XML is always a pain to work with, and there is no easy way to get XML schema into a dict. Most people don’t even use XML correctly; you should use JSON if you just have strings inside of XML tags and nothing more. Every API I’ve ever seen / worked with uses XML in this way, and so they could all replace it with the much easier to parse JSON.

Update: You can now pass in the location as the first argument to the script.

Update 2: You can use any location search format that wunderground supports; this includes zipcode, airport code, city name and state, etc. If Wunderground returns valid XML for your query, pycliweather will parse it; the searches are limited only by the Wunderground API.

In the example below, I’m using ‘dallas texas’. There is also a default specified in the code should a location not be passed.

Anyway, here is what should come out when you run this:

likwid@helios pycliweather(master)$ weather dallas texas Location: dallas+texas Sunrise: 6:18 Sunset: 20:37 Moon visible: 95%

Friday - Partly Cloudy - 79F to 99F - 0% chance of rain Saturday - Partly Cloudy - 79F to 104F - 10% chance of rain Sunday - Partly Cloudy - 79F to 101F - 10% chance of rain Monday - Partly Cloudy - 77F to 99F - 10% chance of rain Tuesday - Chance of a Thunderstorm - 77F to 95F - 20% chance of rain Wednesday - Chance of a Thunderstorm - 76F to 92F - 30% chance of rain

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

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

Source Distribution

pycliweather-0.3.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file pycliweather-0.3.tar.gz.

File metadata

  • Download URL: pycliweather-0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pycliweather-0.3.tar.gz
Algorithm Hash digest
SHA256 ef5ef66c36d30a4be9a450c52039fea1fb7f61c25d04bff4c99ad65cbac4c5c4
MD5 03af338c9c60e2441c069f7bdf214b92
BLAKE2b-256 d436cc95e11e36d5fd340450a7797ec295b90619d70b2729414a8d78c1f96cda

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