kitchen-remodeling-cost 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4b541ad3ddaee349bc36421ba8134bf9bb575526ff3ed247be58c831d31a22b2
4
+ data.tar.gz: 8846d2014cb9d5ec13a6162531789b8bb8f948091b461eb787e63c21f9734a9b
5
+ SHA512:
6
+ metadata.gz: 292b4af9d7866f2456ea8e53fe6a51809eaf9bc1fc458165bf17183c52a87d70b9848ea8d799cdaa4f4f7c58b6ebada62c73de8c3691339e8976f2484ff5cfcc
7
+ data.tar.gz: 361771f245d4f773cf1f0941b80726a45803a85bfa2d990d218f094fbca79b78976d221179cfaf0a4e8a2b42c59f7602ea2eb34ec233a5f624ddf965d1c59293
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bellevue Kitchen Pros
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # kitchen-remodeling-cost: Kitchen Remodeling Cost Planner
2
+
3
+ Plan a kitchen remodel budget that holds. This package splits a budget across 12 line items
4
+ (cabinets, labor, appliances, countertops, flooring, lighting and more), then adds sales tax, a
5
+ contingency reserve and a permit allowance. It works both ways:
6
+
7
+ - **Split**: you know your all-in number. Tax, reserve and permits come out first, the rest is split by line item.
8
+ - **Estimate**: you know the construction cost (or pick a preset). Reserve, tax and permits are added on top.
9
+
10
+ All maths runs in integer cents, so every line adds up exactly to the total. No dependencies, no network.
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ gem install kitchen-remodeling-cost
16
+ ```
17
+
18
+ ## Library
19
+
20
+ ```ruby
21
+ require "kitchen_remodeling_cost"
22
+
23
+ r = KitchenRemodelingCost.split_budget(60_000, permit: 1500) # all-in budget
24
+ puts KitchenRemodelingCost.format_table(r)
25
+ major = KitchenRemodelingCost.estimate_preset("major-midrange", tax_rate: 0.101)
26
+ puts major[:total]
27
+ ```
28
+
29
+ ## Command line
30
+
31
+ ```sh
32
+ kitchen-remodeling-cost split 60000 --permit 1500 # split an all-in budget
33
+ kitchen-remodeling-cost estimate 50000 --tax 10.1 # add reserve, tax and permits to a construction cost
34
+ kitchen-remodeling-cost preset major-upscale # price a Cost vs Value preset
35
+ kitchen-remodeling-cost presets # list presets
36
+ kitchen-remodeling-cost split 80000 --share cabinets=30 # override a line item share
37
+ ```
38
+
39
+ Output of the first command:
40
+
41
+ ```
42
+ Line item Share Amount
43
+ ---------------------------------------------
44
+ Cabinets and shelving 25.0% $12,053.90
45
+ Installation and labor 15.0% $7,232.34
46
+ Appliances 15.0% $7,232.34
47
+ Countertops and backsplash 10.0% $4,821.56
48
+ Flooring 7.0% $3,375.09
49
+ Lighting 5.0% $2,410.78
50
+ Painting and drywall 5.0% $2,410.78
51
+ Designer 5.0% $2,410.78
52
+ Sink and faucet 5.0% $2,410.78
53
+ Doors and windows 4.0% $1,928.63
54
+ Plumbing 3.0% $1,446.47
55
+ Miscellaneous 1.0% $482.16
56
+ ---------------------------------------------
57
+ Construction subtotal $48,215.61
58
+ Contingency reserve (10%) $4,821.56
59
+ Sales tax (10.3%) $5,462.83
60
+ Permit allowance $1,500.00
61
+ ---------------------------------------------
62
+ Total $60,000.00
63
+ ```
64
+
65
+ ## Defaults and sources
66
+
67
+ | Line item | Share |
68
+ |---|---|
69
+ | Cabinets and shelving | 25% |
70
+ | Installation and labor | 15% |
71
+ | Appliances | 15% |
72
+ | Countertops and backsplash | 10% |
73
+ | Flooring | 7% |
74
+ | Lighting, Painting and drywall, Designer, Sink and faucet | 5% each |
75
+ | Doors and windows | 4% |
76
+ | Plumbing | 3% |
77
+ | Miscellaneous | 1% |
78
+
79
+ - Shares: HomeGuide's kitchen remodel cost breakdown. Override any of them; the set is normalised to 100%.
80
+ - Presets: Cost vs Value 2025, Pacific region averages for a 200 sq ft kitchen.
81
+ `minor-midrange` $29,728 (permit allowance $500), `major-midrange` $86,480 ($2,500), `major-upscale` $171,950 ($4,000).
82
+ - Sales tax default: 10.3%, the Bellevue, WA combined rate for October to December 2026 (WA Department of Revenue).
83
+ Washington charges sales tax on the full contract price, labor included. Pass your own rate for other addresses.
84
+ - Contingency reserve default: 10%. Permit allowance is a planning number, not a fee quote.
85
+
86
+ ## Links
87
+
88
+ - Kitchen remodel cost guides and line-item bids: [Kitchen Remodeling Bellevue](https://wakitchenremodelingbellevue.com/)
89
+ - Source and issues: https://github.com/nbkdevs/kitchen-remodeling-bellevue
90
+
91
+ ## License
92
+
93
+ MIT © Bellevue Kitchen Pros
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "json"
5
+ require "optparse"
6
+ require_relative "../lib/kitchen_remodeling_cost"
7
+
8
+ K = KitchenRemodelingCost
9
+ o = { tax_rate: K::DEFAULT_TAX_RATE, contingency_rate: K::DEFAULT_CONTINGENCY_RATE }
10
+ permit = nil
11
+ shares = {}
12
+ json = false
13
+ parser = OptionParser.new do |op|
14
+ op.banner = "Usage: kitchen-remodeling-cost split|estimate <amount> | preset <name> | presets [options]"
15
+ op.on("--tax PERCENT", Float, "sales tax percent (default 10.3)") { |v| o[:tax_rate] = v / 100 }
16
+ op.on("--contingency PERCENT", Float, "reserve percent (default 10)") { |v| o[:contingency_rate] = v / 100 }
17
+ op.on("--permit DOLLARS", Float, "permit allowance") { |v| permit = v }
18
+ op.on("--share KEY=PERCENT", "override a line item share") { |v| k, p = v.split("=", 2); shares[k] = Float(p) }
19
+ op.on("--json", "JSON output") { json = true }
20
+ end
21
+ begin
22
+ cmd, val = parser.parse(ARGV)
23
+ o[:shares] = shares unless shares.empty?
24
+ r = case cmd
25
+ when "presets"
26
+ K::PRESETS.each do |n, p|
27
+ puts format("%-15s %-26s %s permit %s", n, p[:label], K.money(p[:construction]), K.money(p[:permit]))
28
+ end
29
+ puts "Source: #{K::PRESET_SOURCE}"
30
+ exit 0
31
+ when "split" then K.split_budget(Float(val), **o, permit: permit || 0)
32
+ when "estimate" then K.estimate(Float(val), **o, permit: permit || 0)
33
+ when "preset" then K.estimate_preset(val, **o, permit: permit)
34
+ else
35
+ puts parser
36
+ exit 0
37
+ end
38
+ puts json ? JSON.pretty_generate(r) : K.format_table(r)
39
+ rescue ArgumentError, TypeError, OptionParser::ParseError => e
40
+ warn "error: #{e.message}"
41
+ exit 1
42
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KitchenRemodelingCost
4
+ VERSION = "1.0.0"
5
+ end
@@ -0,0 +1,153 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "kitchen_remodeling_cost/version"
4
+
5
+ # Kitchen remodeling cost planner: split a kitchen remodel budget by line item and add
6
+ # sales tax, a contingency reserve and a permit allowance. All maths in integer cents.
7
+ # More kitchen remodel planning: https://wakitchenremodelingbellevue.com/
8
+ module KitchenRemodelingCost
9
+ class Error < ArgumentError; end
10
+
11
+ LINE_ITEMS = [
12
+ ["cabinets", "Cabinets and shelving", 0.25],
13
+ ["labor", "Installation and labor", 0.15],
14
+ ["appliances", "Appliances", 0.15],
15
+ ["countertops", "Countertops and backsplash", 0.10],
16
+ ["flooring", "Flooring", 0.07],
17
+ ["lighting", "Lighting", 0.05],
18
+ ["painting", "Painting and drywall", 0.05],
19
+ ["design", "Designer", 0.05],
20
+ ["sink", "Sink and faucet", 0.05],
21
+ ["doors_windows", "Doors and windows", 0.04],
22
+ ["plumbing", "Plumbing", 0.03],
23
+ ["misc", "Miscellaneous", 0.01]
24
+ ].map(&:freeze).freeze
25
+
26
+ PRESETS = {
27
+ "minor-midrange" => { label: "Minor remodel, midrange", construction: 29_728, permit: 500 },
28
+ "major-midrange" => { label: "Major remodel, midrange", construction: 86_480, permit: 2500 },
29
+ "major-upscale" => { label: "Major remodel, upscale", construction: 171_950, permit: 4000 }
30
+ }.freeze
31
+
32
+ DEFAULT_TAX_RATE = 0.103
33
+ DEFAULT_CONTINGENCY_RATE = 0.10
34
+ PRESET_SOURCE = "Cost vs Value 2025, Pacific region averages (200 sq ft kitchen)"
35
+ SHARE_SOURCE = "HomeGuide kitchen remodel cost breakdown"
36
+
37
+ module_function
38
+
39
+ def rnd(x)
40
+ (x + 0.5).floor
41
+ end
42
+
43
+ def num(name, v, max = nil)
44
+ raise Error, "#{name} must be a finite number >= 0" unless v.is_a?(Numeric) && v.to_f.finite? && v >= 0
45
+ raise Error, "#{name} must be <= #{max}" if max && v > max
46
+
47
+ v.to_f
48
+ end
49
+
50
+ # Defaults merged with overrides ({key => weight}), normalised to sum to 1.
51
+ def normalise_shares(overrides = nil)
52
+ items = LINE_ITEMS.map { |k, l, s| { key: k, label: l, share: s } }
53
+ (overrides || {}).each do |k, v|
54
+ it = items.find { |i| i[:key] == k.to_s } or raise Error, "unknown line item: #{k}"
55
+ it[:share] = num("share #{k}", v)
56
+ end
57
+ sum = 0.0
58
+ items.each { |i| sum += i[:share] }
59
+ raise Error, "shares must not all be zero" unless sum.positive?
60
+
61
+ items.each { |i| i[:share] /= sum }
62
+ end
63
+
64
+ def allocate(cents, items)
65
+ rows = items.each_with_index.map do |it, idx|
66
+ raw = cents * it[:share]
67
+ base = raw.floor
68
+ it.merge(idx: idx, cents: base, frac: raw - base)
69
+ end
70
+ left = cents - rows.sum { |r| r[:cents] }
71
+ order = rows.sort_by { |r| [-r[:frac], r[:idx]] }
72
+ j = 0
73
+ while left.positive?
74
+ order[j % order.size][:cents] += 1
75
+ j += 1
76
+ left -= 1
77
+ end
78
+ rows.map { |r| { key: r[:key], label: r[:label], share: r[:share], amount: r[:cents] / 100.0 } }
79
+ end
80
+
81
+ def opts(tax_rate, contingency_rate, permit, shares)
82
+ [num("tax_rate", tax_rate, 1), num("contingency_rate", contingency_rate, 1), num("permit", permit),
83
+ normalise_shares(shares)]
84
+ end
85
+
86
+ def result(mode, c, k, t, p, tax, cont, items)
87
+ { mode: mode, lines: allocate(c, items), construction: c / 100.0, contingency: k / 100.0,
88
+ tax: t / 100.0, permit: p / 100.0, total: (c + k + t + p) / 100.0,
89
+ tax_rate: tax, contingency_rate: cont }
90
+ end
91
+
92
+ # Forward estimate from a construction (pre-tax) cost.
93
+ def estimate(construction, tax_rate: DEFAULT_TAX_RATE, contingency_rate: DEFAULT_CONTINGENCY_RATE,
94
+ permit: 0, shares: nil)
95
+ tax, cont, perm, items = opts(tax_rate, contingency_rate, permit, shares)
96
+ c = rnd(num("construction", construction) * 100)
97
+ k = rnd(c * cont)
98
+ t = rnd((c + k) * tax)
99
+ result("estimate", c, k, t, rnd(perm * 100), tax, cont, items)
100
+ end
101
+
102
+ # Split an all-in budget (tax, reserve and permits included) into line items.
103
+ def split_budget(total, tax_rate: DEFAULT_TAX_RATE, contingency_rate: DEFAULT_CONTINGENCY_RATE,
104
+ permit: 0, shares: nil)
105
+ tax, cont, perm, items = opts(tax_rate, contingency_rate, permit, shares)
106
+ p = rnd(perm * 100)
107
+ a = rnd(num("total", total) * 100) - p
108
+ raise Error, "total must be larger than the permit allowance" unless a.positive?
109
+
110
+ c = rnd(a / ((1 + cont) * (1 + tax)))
111
+ k = rnd(c * cont)
112
+ t = rnd((c + k) * tax)
113
+ k += a - c - k - t
114
+ result("split", c, k, t, p, tax, cont, items)
115
+ end
116
+
117
+ # Estimate a Cost vs Value preset; permit: overrides the preset allowance.
118
+ def estimate_preset(name, tax_rate: DEFAULT_TAX_RATE, contingency_rate: DEFAULT_CONTINGENCY_RATE,
119
+ permit: nil, shares: nil)
120
+ p = PRESETS[name.to_s] or raise Error, "unknown preset: #{name} (use #{PRESETS.keys.join(", ")})"
121
+ r = estimate(p[:construction], tax_rate: tax_rate, contingency_rate: contingency_rate,
122
+ permit: permit || p[:permit], shares: shares)
123
+ { preset: name.to_s, label: p[:label] }.merge(r)
124
+ end
125
+
126
+ def money(v)
127
+ c = rnd(v * 100)
128
+ d = (c / 100).to_s.reverse.scan(/\d{1,3}/).join(",").reverse
129
+ format("$%<d>s.%<r>02d", d: d, r: c % 100)
130
+ end
131
+
132
+ def pct(rate)
133
+ format("%.2f", rate * 100).sub(/0+\z/, "").sub(/\.\z/, "")
134
+ end
135
+
136
+ # Plain-text itemised table.
137
+ def format_table(r)
138
+ rows = r[:lines].map { |l| [l[:label], format("%.1f%%", l[:share] * 100), money(l[:amount])] }
139
+ rows << ["Construction subtotal", "", money(r[:construction])]
140
+ rows << ["Contingency reserve (#{pct(r[:contingency_rate])}%)", "", money(r[:contingency])]
141
+ rows << ["Sales tax (#{pct(r[:tax_rate])}%)", "", money(r[:tax])]
142
+ rows << ["Permit allowance", "", money(r[:permit])]
143
+ rows << ["Total", "", money(r[:total])]
144
+ head = ["Line item", "Share", "Amount"]
145
+ w = (0..2).map { |c| ([head[c].size] + rows.map { |x| x[c].size }).max }
146
+ line = ->(x) { "#{x[0].ljust(w[0])} #{x[1].rjust(w[1])} #{x[2].rjust(w[2])}" }
147
+ sep = "-" * (w.sum + 4)
148
+ body = rows.map(&line)
149
+ body.insert(r[:lines].size, sep)
150
+ body.insert(body.size - 1, sep)
151
+ [line.call(head), sep, *body].join("\n")
152
+ end
153
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kitchen-remodeling-cost
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bellevue Kitchen Pros
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Split a kitchen remodel budget across 12 line items (cabinets, labor,
13
+ appliances, countertops, flooring and more), add sales tax, a contingency reserve
14
+ and a permit allowance, or price a Cost vs Value preset. Integer-cent maths. Library
15
+ + CLI, no dependencies.
16
+ executables:
17
+ - kitchen-remodeling-cost
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - LICENSE
22
+ - README.md
23
+ - exe/kitchen-remodeling-cost
24
+ - lib/kitchen_remodeling_cost.rb
25
+ - lib/kitchen_remodeling_cost/version.rb
26
+ homepage: https://wakitchenremodelingbellevue.com/
27
+ licenses:
28
+ - MIT
29
+ metadata:
30
+ homepage_uri: https://wakitchenremodelingbellevue.com/
31
+ source_code_uri: https://github.com/nbkdevs/kitchen-remodeling-bellevue
32
+ bug_tracker_uri: https://github.com/nbkdevs/kitchen-remodeling-bellevue/issues
33
+ rubygems_mfa_required: 'true'
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '3.0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubygems_version: 4.0.20
49
+ specification_version: 4
50
+ summary: 'Kitchen remodeling cost planner: line-item budget split, sales tax, reserve
51
+ and permits.'
52
+ test_files: []