1.0.4 • Published 7 years ago

activity-names v1.0.4

Weekly downloads
6
License
AGPL-3.0
Repository
github
Last release
7 years ago

Activity-names

Normalise rando activity names from various fitness apis.

Usage:

  const activityTypes = require('activity-types')
  const rawName = getActivityNameFromSomeWhere()
  const normcoreName = activityTypes(rawName)
  // ...now do some aggregations that prefer normalised names.
'Ride' => 'Cycling'
'Bike Riding' => 'Cycling'
'Biking' => 'Cycling'

Standardising on Google Fit names as they are the most comprehensive, except on the issue of "Biking", which is "Cycling".

More generally the normalisation is:

  • Sentence case (unless a brand name like CrossFit)
  • Slashy alt names, pick the first one. "Boxing / MMA" => "Boxing".
  • Remove redundant qualifying paranetheses
    • "Inline skating (rollerblading)" => "Inline skating"
  • Any of /Other.* /, falsey, => 'Activity'.
  • Defer to the Google fit one if no strong reason not to.

Use https://github.com/samuelmr/google-fit-activity-types to convert from a google-fit numeric activity id to a activity name first.


A (╯°□°)╯︵TABLEFLIP side project.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago