Shopify / product-taxonomy

Shopify's standardized product taxonomy.
MIT License
99 stars 15 forks source link

Shopify's Standard Product Taxonomy Version

🌍 Global Standard: Our open-source, standardized product taxonomy establishes a universal language for product classification. Comprehensive and already empowering merchants on Shopify.

πŸ‘©πŸΌβ€πŸ’» Integration Friendly: With a stable structure and diverse formats our taxonomy is designed for effortless integration into any system.

πŸš€ Industry Benchmark: Spanning 25+ essential verticals, our taxonomy encompasses categories, attributes, and values, all thoughtfully integrated within Shopify and numerous marketplaces.

Learn more on help.shopify.com

πŸ—‚οΈ Table of Contents

πŸ“š The Taxonomy

Our taxonomy is an open-source comprehensive, global standard for product classification. It's a universal language that empowers merchants to categorize their products. Spanning 25+ essential verticals, our taxonomy encompasses categories, attributes, and values, all thoughtfully integrated within Shopify and numerous marketplaces.

πŸ•ΉοΈ Interactive explorer

Ready to dive in? Explore our taxonomy interactively to visualize and discover what's published across the many categories, attributes, and values.

🧭 Getting started

This repository is the home of Shopify's Standard Product Taxonomy. It houses the source-of-truth data, the distribution files for implementation, and the source code that makes this all sing.

You can think of this repository serving 3 primary users:

  1. Integrators: Those who integrate the taxonomy into other systems. You want stable distribution files.
  2. Taxonomists: Those who want to evolve the taxonomy itself. Submit a change request or work directly with the source-of-truth data files themselves.
  3. Developers: Those who want to evolve how this ETL pipeline works, or add richer tooling for other users. You work with the application files.

🧩 1. Integrators: How to integrate with the taxonomy

Dive straight into dist to find the files you need and integrate this taxonomy into your system.

We offer txt and json formats to make it easy to integrate with your systems. If you have a specific format you'd like to see, please open an issue and let us know!

πŸ—ΊοΈ Mapping to other taxonomies

To make it easier to integrate with the taxonomy, we have also included a set of data called mappings. These are rules that can be used to convert between categories and attributes in the Shopify taxonomy to categories and attributes of another taxonomy. For more on mappings see documentaton in the integrations directory.

πŸ§‘πŸΌβ€πŸ« 2. Taxonomists: How to make changes to the taxonomy

Submit a taxonomy tree change request to give us insight and evolve the taxonomy. This is the simplest way to effect change.

Alternatively, you may submit PRs directly yourself against the source-of-truth files in data/.

If you make changes to any files in data/, you'll need to update the distribution files. There are two ways:

  1. Make a PR comment of /generate_dist to have CI commit the changes for you πŸ€–
  2. Run make locally and commit the changes yourself

🌐 Localization to other languages

Our taxonomy supports translations to various languages in the localizations directory. To report a translation issue (non-English text), submit a localization fix request.

πŸ‘©πŸΌβ€πŸ’» 3. Developers: How to evolve the system

Everything else is how we manage the taxonomy and generate distributions. This is where the magic happens.

This is a simple ETL app composed of a few core models. The app is built on Rails and Jekyll:

πŸ› οΈ Setup and dependencies

For Shopify employees or folks with minidev:

For everyone else you'll need to:

⛰️ Common tasks

Here are the commands you'll use most often:

make [build]  # build the dist and documentation files
make clean    # remove sentinels and generated files
make seed     # parse data/ into local db
make console  # irb with dependencies loaded
make test     # run ruby tests and cue schema verification
make run_docs # http://localhost:4000 interactive view of dist/

If you want to add a new distribution format, you'll need to do 3 things:

  1. Add new serialization methods to relevant models (e.g., Category#as_json, Category#as_pkl)
  2. Extend bin/generate_dist to write files in the new format
  3. Extend the Makefile to add the new file format to the clean target

πŸ“‚ Navigating this repository

This is a Rails app after all, so we'll give a map of the novel pieces of our system:

β”œβ”€β”€ Makefile             # key dev and build commands
β”œβ”€β”€ app/                 # rails standard
β”œβ”€β”€ bin/
β”‚   β”œβ”€β”€ generate_dist    # primary entrypoint for generating dist/
β”‚   └── generate_docs    # primary entrypoint for generating docs/
β”œβ”€β”€ db/
β”‚   β”œβ”€β”€ schema.rb        # because this is a local-only app, we don't use migrations
β”‚   └── seed.rb          # a custom seed script to load data/ into the local db
β”œβ”€β”€ dist/                # generated distribution files
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ integrations/    # integrations and mappings between taxonomies
β”‚   └── localizations/   # localizations for categories, attributes, and values
β”‚   β”œβ”€β”€ categories/      # source-of-truth for categories
β”‚   β”œβ”€β”€ attributes.yml   # source-of-truth for attributes
β”‚   └── values.yml       # source-of-truth for values
└── test/                # rails standard

πŸ§‘β€πŸ’» Contributing

We welcome contributions! Before we can merge any changes you submit via PR, you'll need to sign the Shopify CLA (a friendly robot will help when you open your first PR πŸ€–).

πŸ“… Releases

You can always find the current published version in VERSION. The changelog is available in CHANGELOG.md.

Versions are determined by CalVer, in sync with Shopify's API release schedule.

That means a stable release every 3 months at most, at the beginning of the quarter. Version names are date-based to be meaningful and semantically unambiguous (for example, 2024-07).

Formal releases are published as Github releases and available on the interactive docs site.

πŸ“œ License

Shopify's Product Taxonomy is released under the MIT License. So go ahead, explore, play, and build something awesome!