uwdart 0.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

UWDart

Waterloo OpenData Client in Dart. UWDart will supports all OpenData endpoints, and will processes all returned data in JSON.

This project is under development at the moment but version 0.0.* versions are released. Supported EndPoints:

  • [x] Course
  • [x] News
  • [x] API
  • [ ] FoodServices
  • [ ] Feds
  • [ ] Awards
  • [ ] Events
  • [ ] Blogs
  • [ ] Opportunities
  • [ ] Services
  • [ ] Weather
  • [ ] Terms
  • [ ] Resources
  • [ ] Codes
  • [ ] Building
  • [ ] Poi
  • [ ] Parking
  • [ ] Transit
  • [ ] Directory
  • [ ] Wireless
  • [ ] Server

In order to use this package, check Dart Package management and search for uwdart package.

The link to the latest version of uwdart is: https://pub.dartlang.org/packages/uwdart

Check Change Logs for all the changes being made.

Waterloo OpenData Api Documentation

https://github.com/uWaterloo/api-documentation

License

UWDart is licensed under the MIT License. See the LICENSE file for more information.

Waterloo OpenData is licensed under ODL (Open Data License) Agreement

0.0.4

Added

  • Static ResponseParser
  • Added Static types where ever possible.
  • Exported API Endpoint for client to use.

Modified

  • Every Endpoint now uses ResponseParser to cast from map to objects.

0.0.3

Added

  • Implemented and documented API endpoint.
  • A Generic example added for all the Endpoints since they are similar.
  • Version 0.0.3 published.

Modified

  • Renamed CourseAPI, NewsAPI, UWAPI to CourseEndpoint, NewsEndpoint, and UWEndpoint respectively.
  • Deleted individual examples for course and news endpoints.
  • Internally modified how map data was being deserialize to objects.
  • Added static types for OpenConnection and CloseConnection.

0.0.1

Added

  • News API and Course API implemented and documented.
  • Examples added for CourseAPI and NewsAPI.
  • Initial version published.

example/example.dart

import 'dart:async';
import 'package:uwdart/uwdart.dart';

String apiKey = "KEY GOES HERE";

Future main() async {
  // create a client by providing it a key
  var client = OpenConnection(apiKey);

  // Create CourseEndpoint object to use Course Endpoints
  CourseEndpoint courseEndpoint = new CourseEndpoint(client);

  // Gives access to all the courses available at UW
  await courseEndpoint.getAllCourses().then((courses) async {
    for (int i = 0; i < 50; i++ ) {
      print("Title: " + courses[i].title);
      String catalogNum =  courses[i].catalogNumber;
      String subject = courses[i].subject;

      // based on the subject and catalog number, get detailed info about the package
      await courseEndpoint.getCourseBySubjectCatalog(subject, catalogNum).then((course) {
        print("-> URL for ${courses[i].catalogNumber}: " + course.url);
      });
    }
    print("");
  });

  // Create NewsEndpoint object to use News Endpoints
  NewsEndpoint newsEndpoint = new NewsEndpoint(client);

  // Gives access to all the news available at UW (top 100)
  await newsEndpoint.GetAllNews().then((news) async {
    for (var currNews in news) {
      // get news and the link
      print(currNews.title + "    ->   " + currNews.link);

      String site = currNews.site;
      num id = currNews.id;

      // using site and id detail news article can be gathered
      await newsEndpoint.GetNewsBySiteAndID(site, id).then((detailedNews) {
        print("IMAGE of ${currNews.id}:  ${detailedNews.image.url}");
      });
    }
  });

  // close the connection when all done
  await CloseConnection(client);

  /*
  These are few examples on using endpoints to access data for various UW API services. Other
  endpoints are similar and their documentation can be checked for details about their
  functionality and Data structure their provide.
   */
}

1. Depend on it

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


dependencies:
  uwdart: "^0.0.4"

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:uwdart/uwdart.dart';
        
Version Uploaded Documentation Archive
0.0.4 Apr 10, 2018 Go to the documentation of uwdart 0.0.4 Download uwdart 0.0.4 archive
0.0.3 Apr 10, 2018 Go to the documentation of uwdart 0.0.3 Download uwdart 0.0.3 archive
0.0.2 Apr 7, 2018 Go to the documentation of uwdart 0.0.2 Download uwdart 0.0.2 archive
0.0.1 Apr 7, 2018 Go to the documentation of uwdart 0.0.1 Download uwdart 0.0.1 archive

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50
Learn more about scoring.

Platforms

Detected platforms: web, other

Primary library: package:uwdart/uwdart.dart with components: mirrors.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run dartfmt to format lib/src/course/course_endpoint.dart.

    Run dartfmt to format lib/src/data/api_request.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
dartson ^0.2.7 0.2.7
http ^0.11.3+16 0.11.3+16
Transitive dependencies
analyzer 0.29.11 0.31.1
args 0.13.7 1.4.2
async 2.0.6
barback 0.15.2+15
charcode 1.1.1
cli_util 0.0.1+2 0.1.2+1
collection 1.14.9
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.3
http_parser 3.1.1
isolate 1.1.0 2.0.0
logging 0.11.3+1
meta 1.1.2
package_config 1.0.3
path 1.5.1
plugin 0.2.0+2
pool 1.3.4
source_maps 0.10.4
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
when 0.2.0
which 0.1.3
yaml 2.1.13