https://github.com/ankane/plu
Price look-up codes made easy
https://github.com/ankane/plu
Last synced: 7 months ago
JSON representation
Price look-up codes made easy
- Host: GitHub
- URL: https://github.com/ankane/plu
- Owner: ankane
- License: mit
- Created: 2013-09-18T09:58:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-01-31T03:47:33.000Z (over 1 year ago)
- Last Synced: 2025-03-28T09:08:17.523Z (about 1 year ago)
- Language: Ruby
- Size: 63.5 KB
- Stars: 49
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PLU
[Price look-up codes](https://en.wikipedia.org/wiki/Price_look-up_code) made easy
:watermelon: 4032
:banana: 4011
:grapes: 4023
Data cleaned up from the [International Federation of Produce Standards](https://www.ifpsglobal.com/)
[](https://github.com/ankane/plu/actions)
## Installation
Add this line to your application’s Gemfile:
```ruby
gem "plu"
```
## Getting Started
List known PLUs
```ruby
PLU.all
```
Get name from PLU
```ruby
PLU.new(4011).name # Bananas
```
Check if valid
```ruby
PLU.new(2000).valid? # false
```
### 5-Digit PLUs
For PLUs with 5 digits, the first digit has a special meaning: 9 specifies organic.
4011 - Bananas :banana:
94011 - Organic bananas :banana:
```ruby
PLU.new(94011).organic? # true
```
### Retailer Assigned
```ruby
PLU.new(3170).retailer_assigned? # true
```
## History
View the [changelog](https://github.com/ankane/plu/blob/master/CHANGELOG.md)
## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- [Report bugs](https://github.com/ankane/plu/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/plu/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
```sh
git clone https://github.com/ankane/plu.git
cd plu
bundle install
bundle exec rake test
```