plu

package module
v0.0.0-...-dbe3a7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 6 Imported by: 0

README

PLU

Godoc Build Status

Price look-up codes made easy

🍉 4032 🍌 4011 🍇 4023

Download PLU codes - data cleaned up from the Produce Marketing Association

How To Use

Initialize (only first call reads csv file)

import "github.com/ferhatelmas/plu"

codes, err := plu.New()

List known PLUs

codes.All()

Get name from PLU

codes.Name(4011) // Bananas

Check if valid

codes.Valid(2000) // false
5-Digit PLUs

For PLUs with 5 digits, the first digit has a special meaning: 9 specifies organic, and 8 specifies genetically modified.

4011 - Bananas 🍌 94011 - Organic bananas 🍌 84011 - Genetically modified bananas

codes.Organic(94011) // true
codes.GM(84011)      // true
Retailer Assigned
codes.RetailerAssigned(3170) // true

Installation

By go tool

go get github.com/ferhatelmas/plu

TODO

  • clean up data

Resources

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codes

type Codes interface {
	Valid(interface{}) bool
	Organic(interface{}) bool
	GM(interface{}) bool
	RetailerAssigned(interface{}) bool
	Name(interface{}) string
	All() map[string]string
}

Codes provides easy access into Price Lookup Code Mapping

func New

func New() (Codes, error)

New reads codes if first call and then creates an accessor for codes

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL