bpm_client 1.0.0

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

bpm_client #

A library that makes it easy to interact with the GetSongBPM API to get beats per minute for many songs.

This is built using the Dart Programming Language with its only dependency being the http package. This means it should work in any Dart code from Flutter to Web to Server.

Usage #

Make sure to go to the GetSongBPM Website and register for an API key. This is required for accessing the API.

import 'package:bpm_client/bpm_client.dart';

final client = GetSongBPMClient('YOUR_API_KEY');

final song = await client.song('o2r0L');
print(song);

final artist = await client.artist('nZR');
print(artist);

final songResults = await client.songSearch('Master of Puppets');
songResults.songs.forEach((s) => print(s));

final artistResults = await client.artistSearch('Metallica');
artistResults.artists.forEach((a) => print(a));

final searchResults = await client.songAndArtistSearch('Master of Puppets', 'Metallica');
searchResults.items.forEach((s) => print(s));

Testing #

Testing is limited at this time and the http client is mocked so you don't actually hit the API. Tests need to be expanded.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version of GetSongBPM API for Dart

example/bpm_client_example.dart

import 'package:bpm_client/bpm_client.dart';

void main() async {
  final client = GetSongBPMClient('YOUR_API_KEY');

  final song = await client.song('o2r0L');
  print(song);

  final artist = await client.artist('nZR');
  print(artist);

  final songResults = await client.songSearch('Master of Puppets');
  songResults.songs.forEach((s) => print(s));

  final artistResults = await client.artistSearch('Metallica');
  artistResults.artists.forEach((a) => print(a));

  final searchResults =
      await client.songAndArtistSearch('Master of Puppets', 'Metallica');
  searchResults.items.forEach((s) => print(s));
}

Use this package as a library

1. Depend on it

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


dependencies:
  bpm_client: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:bpm_client/bpm_client.dart';
  
Version Uploaded Documentation Archive
1.0.0 Jan 10, 2019 Go to the documentation of bpm_client 1.0.0 Download bpm_client 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:bpm_client/bpm_client.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0 0.12.0+2
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
path 1.6.2
pedantic 1.5.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
mockito ^4.0.0
test ^1.0.0