Coder Social home page Coder Social logo

google-taxonomy-matcher's Introduction

google-taxonomy-matcher

Matches unstructured product data to a category of Google's Taxonomy for use with Merchant Center Feeds.

Install

npm install google-taxonomy-matcher --save

Usage

const taxonomyMatcher = require('google-taxonomy-matcher');

// new taxonomyMatcher(<taxonomy locale>, <match threshold>)
// <taxonomy locale> = the locale extension of the taxonomy file from Google 
// <match threshold> = how close the search term must be to the matched result
const matcher = new taxonomyMatcher('en-GB', 100)

// matcher.match(<search term>, <minisearch opts>)
// <search term> = Your unstructured search query, E.G. "product title + product category"
// <minisearch opts> see -> https://www.npmjs.com/package/minisearch
matcher.match('Roll Up Cotton Chino Shorts Womens > Shorts > Casual')
/*{ 
  id: 207, // Matched Google Category ID
  terms: [ 'shorts' ], // Searched Terms
  score: 457.7377034211667, // Matched Score (see <match threshold>)
  match: { shorts: [ 'category', 'full_path_scrubbed' ] }, // Matched Terms
  full_path: 'Clothing & Accessories > Clothing > Shorts'  // Matched Google Category
}*/

Links

Google Merchant Center -> https://support.google.com/merchants/answer/6324436
MiniSearch -> https://www.npmjs.com/package/minisearch
Python Version -> https://github.com/BernhardWenzel/google-taxonomy-matcher
Inspiration -> https://bernhardwenzel.com/articles/automatically-matching-category-google-shopping/

Disclaimer

D3VL Provides this software 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Made with ❤️ By D3VL

v1.0.0

google-taxonomy-matcher's People

Contributors

accountmoved avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.