weather_underground_api 0.1.5

  • README.md
  • Installing
  • Versions
  • 0

What is this thing?

This is a library for providing access to the Weather Underground API to Dart applications.
It provides for asynchronous access to the REST API for dart:io based applications, support for dart:html is on the road map for release in June.

Where can I get it?

You can add it to your project directly in the Dart Editor by including weather_underground_api in your project. You can also contribute to the project via github.

How do I use it?

WeatherUndergound wu = new WeatherUnderground("apikeyhere", "84096");

wu.getConditions().then((var val) {
  print(val.toString());
});

Exceptions

There are currently three exceptions that this API can throw. Unfortuantely, the WeatherUnderground API documentation does not define any error return values, though it does return some, so more may be added as I come across them. For now, the following exceptions may be thrown:

  • QueryNotFound - Raised if the defined query string does not return an appropriate result for the assigned query.
  • KeyNotFound - Raised if the API key provided at instantiation is not valid at WeatherUnderground.
  • UnknownException - This should not be seen in the wild, but is provided in the likely case that new errors are discovered. If you find this being thrown, let me know so I can add more code around it.
  • TimeoutException - Occurs if an API request takes longer than the timout (default 2000 ms or 2 seconds) to complete.

Notes

  • If your API key does not include access to a particular function, the WeatherUndergound returns no indication that access is not allowed, other than a complete data structure with no values.
  • This library also does no checking to ensure values provided from WeatherUndergound are valid. This will be addressed in a later version.
  • Per the WeatherUndergound Terms Of Service, the WU logo must be included with a credit line where the returned data is displayed.

TODO

  • Check that returned values are valid. This is to catch the case where a request is made for a feature not supported by the API key license level. Unfortunately, this does not appear to be easily discerned from the data returned by WU.
  • Implement dart:html library support (in addition to dart:io)
  • Implement radar
  • Implement satellite
  • Implement radar + satellite
  • Modify returned values to intended types instead of strings
  • Implement multiple feature requests
  • Include code samples in documentation

Change Log

  • 0.1.5
    • Added code comments and verified proper generation by the Dartdoc generator
    • Fixed bone headed exception handling
  • 0.1.4
    • Added timeout functionality to handle requests that never come back
    • Autocomplete API implemented
  • 0.1.3
    • Added better error handling and documentation
  • 0.1.2
    • Fixed a left behind debug print statement
    • Added very basic error checking for malformed server request URI's
    • Removed strong typing for API results
  • 0.1.1
    • Minor Cosmetic Changes
  • 0.1.0
    • Initial Revision

Authors and Contributors

To date, all code has been written by Ira Burton (@iburton), a very rookie Dart programmer. If something is not working correctly, it is likely because he made some sort of dunderheaded mistake. Please feel free to thoroughly bash him for all mistakes so he can learn the right way to do it. There is no pride of authorship here.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  weather_underground_api: ^0.1.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:weather_underground_api/weather_underground_api.dart';
  
Version Uploaded Documentation Archive
0.1.5 Jun 20, 2013 Go to the documentation of weather_underground_api 0.1.5 Download weather_underground_api 0.1.5 archive
0.1.4 Jun 18, 2013 Go to the documentation of weather_underground_api 0.1.4 Download weather_underground_api 0.1.4 archive
0.1.3 Jun 17, 2013 Go to the documentation of weather_underground_api 0.1.3 Download weather_underground_api 0.1.3 archive
0.1.2 Jun 11, 2013 Go to the documentation of weather_underground_api 0.1.2 Download weather_underground_api 0.1.2 archive
0.1.1 Jun 11, 2013 Go to the documentation of weather_underground_api 0.1.1 Download weather_underground_api 0.1.1 archive
0.1.0 Jun 11, 2013 Go to the documentation of weather_underground_api 0.1.0 Download weather_underground_api 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Error(s) in lib/weather_underground_api.dart: Target of URI doesn't exist: 'dart:json'.

Health issues and suggestions

Fix lib/weather_underground_api.dart. (-86.65 points)

Analysis of lib/weather_underground_api.dart failed with 7 errors, including:

line 4 col 8: Target of URI doesn't exist: 'dart:json'.

line 236 col 28: The constructor returns type 'dynamic' that isn't of expected type 'StreamTransformer<List<int>, dynamic>'.

line 236 col 32: Undefined class 'StringDecoder'.

line 238 col 28: The method 'parse' isn't defined for the class 'WeatherUnderground'.

line 257 col 28: The constructor returns type 'dynamic' that isn't of expected type 'StreamTransformer<List<int>, dynamic>'.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Error(s) in lib/weather_underground_api.dart: Target of URI doesn't exist: 'dart:json'.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is too old. (-100 points)

The package was released more than two years ago.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use weather_underground_api.dart.