librus_api 1.0.21

  • Readme
  • Changelog
  • Example
  • Installing
  • 0

A library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:librus_api/librus_api.dart';

main() {
  var awesome = new Awesome();
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version, created by Stagehand

example/librus_api_example.dart

import 'dart:convert';
import 'dart:io';

import 'package:librus_api/librus_api.dart';
import 'package:librus_api/librus_api_base.dart';
import 'package:librus_api/models/grade.dart';
import 'package:librus_api/utils/utils.dart';

main() async {
  LibrusApi.init();
  var api = LibrusApi('./cookies');
  await api.signIn(Platform.environment['LIBRUS_USERNAME'],
      Platform.environment['LIBRUS_PASSWORD']);
  print(await api.refresh());
  var accounts = await api.accounts;
  await accounts[0].refresh();
  var data = json.encode(api);
  print(json.decode(data));
  print(json.encode(await fetchSubjects(accounts[0])));
}

Use this package as a library

1. Depend on it

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


dependencies:
  librus_api: ^1.0.21

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:librus_api/librus_api.dart';
  
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 Dec 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Health issues and suggestions

Fix lib/librus_api_base.dart. (-44.59 points)

Analysis of lib/librus_api_base.dart failed with 2 errors, 3 hints:

line 51 col 41: Too many positional arguments: 0 expected, but 1 found.

line 127 col 41: Too many positional arguments: 0 expected, but 1 found.

line 7 col 8: Unused import: 'package:json_annotation/json_annotation.dart'.

line 31 col 19: Avoid const keyword.

line 110 col 25: Unnecessary new keyword.

Document public APIs. (-1 points)

187 out of 187 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/librus_api.reflectable.dart. (-77.66 points)

Analysis of lib/librus_api.reflectable.dart reported 299 hints, including:

line 23 col 30: Unnecessary new keyword.

line 25 col 9: Unnecessary new keyword.

line 60 col 36: Unnecessary new keyword.

line 62 col 23: Unnecessary new keyword.

line 69 col 9: Unnecessary new keyword.

Fix lib/librus_api_base.reflectable.dart. (-77.66 points)

Analysis of lib/librus_api_base.reflectable.dart reported 299 hints, including:

line 23 col 30: Unnecessary new keyword.

line 25 col 9: Unnecessary new keyword.

line 60 col 36: Unnecessary new keyword.

line 62 col 23: Unnecessary new keyword.

line 69 col 9: Unnecessary new keyword.

Fix additional 19 files with analysis or formatting issues. (-8.98 points)

Additional issues in the following files:

  • lib/misc/activator.dart (5 hints)
  • lib/account.dart (2 hints)
  • lib/account.g.dart (2 hints)
  • lib/models/serializable.dart (2 hints)
  • lib/utils/utils.dart (2 hints)
  • lib/models/category.dart (1 hint)
  • lib/models/comment.dart (1 hint)
  • lib/models/grade.dart (1 hint)
  • lib/models/resource.dart (1 hint)
  • lib/models/subject.dart (1 hint)
  • lib/account.reflectable.dart (Run dartfmt to format lib/account.reflectable.dart.)
  • lib/misc/activator.reflectable.dart (Run dartfmt to format lib/misc/activator.reflectable.dart.)
  • lib/models/category.reflectable.dart (Run dartfmt to format lib/models/category.reflectable.dart.)
  • lib/models/comment.reflectable.dart (Run dartfmt to format lib/models/comment.reflectable.dart.)
  • lib/models/grade.reflectable.dart (Run dartfmt to format lib/models/grade.reflectable.dart.)
  • lib/models/resource.reflectable.dart (Run dartfmt to format lib/models/resource.reflectable.dart.)
  • lib/models/serializable.reflectable.dart (Run dartfmt to format lib/models/serializable.reflectable.dart.)
  • lib/models/subject.reflectable.dart (Run dartfmt to format lib/models/subject.reflectable.dart.)
  • lib/utils/utils.reflectable.dart (Run dartfmt to format lib/utils/utils.reflectable.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Error(s) in lib/librus_api_base.dart: Too many positional arguments: 0 expected, but 1 found.

Support latest dependencies. (-40 points)

The version constraint in pubspec.yaml does not support the latest published versions for 4 dependencies (cookie_jar, dio, html, json_serializable).

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/MatisiekPL/librus-api-dart/ was unreachable.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
cookie_jar ^0.0.7 0.0.8 1.0.1
dio ^1.0.13 1.0.17 3.0.7
html ^0.13.3+3 0.13.4+2 0.14.0+3
http ^0.12.0 0.12.0+2
json_serializable ^2.0.1 2.3.0 3.2.3
reflectable ^2.0.8 2.1.0 2.2.0
Transitive dependencies
analyzer 0.36.4 0.39.2+1
args 1.5.2
async 2.4.0
build 1.1.6 1.2.2
build_config 0.4.1+1
build_daemon 2.1.2
build_resolvers 1.2.1 1.3.0
build_runner_core 3.1.1 4.3.0
built_collection 4.3.0
built_value 7.0.0
charcode 1.1.2
checked_yaml 1.0.2
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.15.0 0.16.1
dart_style 1.2.9 1.3.3
fixnum 0.10.11
front_end 0.1.19 0.1.29
glob 1.2.0
graphs 0.2.0
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 2.3.0 3.0.0
kernel 0.3.19 0.3.29
logging 0.11.3+2
matcher 0.12.6
meta 1.1.8
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
pedantic 1.9.0
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.1.2+1
shelf 0.7.5
shelf_web_socket 0.2.3
source_gen 0.9.4+4 0.9.4+6
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.20 1.1.0
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+13
web_socket_channel 1.1.0
yaml 2.2.0
Dev dependencies
build_runner any 1.6.9 1.7.2
test ^1.0.0