GithubHelp home page GithubHelp logo

pipeline-challenge's Introduction

A simple data-processing challenge using python

Instructions for the challenge are provided below:

This is a data-processing test. You run a minimalist online clothing store which sells exactly one style of each item of clothing - one t-shirt, one pair of socks, one jacket, etc. Each of these comes in a range of colours and sizes. Each specific product sold is uniquely identified by an item code.

The task is to take a set of product data and some tags indicating preferences, and work out which products match those preferences. The utility takes the path to a JSON file containing product data, and comma-separated lists of "include" and "exclude" tags. The products matched shall be those which have ANY of the include tags, and NONE of the exclude tags.

The plumbing of the pipeline.py file is written, including input, output and argument parsing. Your job is to implement the main function, which accepts arguments product_data, a Python data structure corresponding to the parsed JSON input file, and include_tags and exclude_tags, both lists of strings. The function should return a list of PreferenceMatch namedtuples, also defined for you. Each PreferenceMatch has attributes product_name (e.g. "T-Shirt"), and product_codes, a list of the product codes of every matching product that shares that product name.

A make target is provided to run the program - you can invoke it with make run.

EXAMPLE INPUT

(Comes as command line arguments)

product_data.json --include red,green --exclude large

Where product_data.json defines a structure like:

[
  {
    "name": "T-Shirt",
		"tags": ["red", "large"],
		"code": "A21313"
  },
  // etc...
]

EXAMPLE OUTPUT

Print to stdout:

T-Shirt:
A21312

Pants:
A21455

โ— A solution is provided in the solution directory.

pipeline-challenge's People

Contributors

astralite avatar

Watchers

 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.