spyce 1.1.0

Spyce #


Overview #

Spyce is a data collection framework for general purpose. The framework implements high-performance asynchronous pipeline scheduling and exposes an easy-to-use interface. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.

The name "Spyce" originates from Japanese anime television series "Release the Spyce".

1.0.0 #

  • Initial version

1.1.0 #

  • Add experimental distributed computing support


import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:spyce/spyce.dart';

class Languages extends Job {
  final type = 'Languages';
  static const decoder = JsonDecoder();
  String owner, repo;

  Languages(this.owner, this.repo)
      : super('https://api.github.com/repos/$owner/$repo/languages');

  Stream<Pipeline> exec(Service service) async* {
    var languages = decoder.convert((await service['http'].get(name)).body);

  Map<String, dynamic> toJson() {
    return {'name': name, 'owner': owner, 'repo': repo};

  Languages.fromJson(Map<String, dynamic> obj)
      : owner = obj['owner'],
        repo = obj['repo'],

class NewPipeline extends Pipeline {
  final type = 'NewPipeline';
  final owner, repos;

  NewPipeline(String name, this.owner, this.repos)
      : super.fromJobs(name, () sync* {
    for (var repo in repos) {
      yield Languages(owner, repo['name']);

  Map<String, dynamic> toJson() {
    return {'name': name, 'owner': owner, 'repos': repos};

  NewPipeline.fromJson(Map<String, dynamic> obj)
      : owner = obj['owner'],
        repos = obj['repos'],
        super.fromJobs(obj['name'], () sync* {
        for (var repo in obj['repos']) {
          yield Languages(obj['owner'], repo['name']);

class Repos extends Job {
  final type = 'Repos';
  static const decoder = JsonDecoder();
  String owner;

  Repos(this.owner) : super('https://api.github.com/users/$owner/repos');

  Stream<Pipeline> exec(Service service) async* {
    var repos = decoder.convert((await service['http'].get(name)).body);
    yield NewPipeline(name, owner, repos);

  Map<String, dynamic> toJson() {
    return {'name': name, 'owner': owner};

  Repos.fromJson(Map<String, dynamic> obj)
      : owner = obj['owner'],

Future<void> main(List<String> args) async {
  if (args.isEmpty && args[0] != 'server' && args[1] != 'client') {
    print('server or client');
  if (args[0] == 'server') {
    var spyce = Spyce('spyce');
    var runner = RemoteRunner('localhost:8080', 2, '', 8080);
    runner.addPipeline('NewPipeline', NewPipeline);
  } else {
    var service = Service();
    service['http'] = http.Client();
    var runner = Runner('runner', service, 2);
    var spyce = RemoteSpyce(runner);
    spyce.addJob('Repos', Repos);
    spyce.addJob('Languages', Languages);
    await spyce.start(8080);

Use this package as a library

1. Depend on it

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

  spyce: ^1.1.0

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:spyce/spyce.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19


Detected platforms: other

Primary library: package:spyce/spyce.dart with components: io, mirrors.

Health issues and suggestions

Document public APIs. (-0.50 points)

58 out of 59 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/src/runner.dart. (-0.50 points)

Analysis of lib/src/runner.dart reported 1 hint:

line 36 col 11: DO use curly braces for all flow control structures.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (grpc).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
grpc ^1.0.2 1.0.3 2.1.0
protobuf ^0.13.9 0.13.15
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.2
fixnum 0.10.9
googleapis_auth 0.2.10
http2 1.0.0
http_parser 3.1.3
meta 1.1.7
path 1.6.4
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
http ^0.12.0+2 0.12.0+2
pedantic ^1.0.0 1.8.0+1
test ^1.0.0