Socket
Socket
Sign inDemoInstall

activity-names

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    activity-names

Normalised fitness activity names


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Install size
185 kB
Created
Weekly downloads
 

Readme

Source

Activity-names

Normalise rando activity names from various fitness apis.

Usage:

  const activityNames = require('activity-names')
  const rawName = getActivityNameFromSomeWhere()
  const normcoreName = activityNames(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.

FAQs

Last updated on 23 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc