soil_builder.py

This is a simple little program I wrote to help me mix up garden soil. It’s much cheaper to mix your own and the quality will be better if you source your own ingredients.

#! /usr/bin/python

# Rice Hulls come out of CSPM portion of the base mix 
HULLS = .05

# Rockdust: (4-10 Cups per CF) 
ROCK_DUST = 8

# BioChar: (10% of overall mix)
BIOCHAR = .10

#Amendments: (.5-1 Cup per CF)   
NEEM = 1
KELP = 1
CRAB = 1
ALFALFA = 1 
MBP = 1
OYSTER = 1
GYPSUM = .5

# Constants
GAL_TO_CF = 7.48
HUMUS = .33

bales = raw_input("How many bales of CSPM are you mixing today? ") 
bale_size = float(bales) * 5

# Assume 1:1:1 mix and deviate from there
mix_size = bale_size*3

print "\n{} bale(s) of CSPM contains to roughly {} Cubic Feet or {} Gallons " .format(bales, bale_size, bale_size * GAL_TO_CF)

# 40/30/25/5  (Aeration/Humus/CSPM/Hulls)
aeration = raw_input("\nEnter desired aeration % in whole numbers. ")
aeration = (float(aeration) / 100)

air_amnt = (aeration * mix_size)

cspm_correction = (aeration - HUMUS) / 2 
HUMUS = HUMUS - cspm_correction

cspm = (1 - (aeration + HUMUS + HULLS))

cspm_amnt = cspm * mix_size 

HUMUS = (1 - (aeration + cspm + HULLS))

humus_amnt = HUMUS * mix_size

hulls_amnt = HULLS * mix_size


print "\nYou start with {} Cubic Feet or {} Gallons of CSPM" .format(cspm_amnt, cspm_amnt * GAL_TO_CF)

print "\nYou need {} Cubic Feet or {} Gallons of Aeration" .format(air_amnt, air_amnt * GAL_TO_CF)  

print "\nyou need {} Cubic Feet or {} Gallons of Humus" .format(humus_amnt, humus_amnt * GAL_TO_CF)

print "\nyou need {} Cubic Feet or {} Gallons of Hulls" .format(hulls_amnt, hulls_amnt * GAL_TO_CF)

print "-" * 80
print "You will have {} CF or {} Gallons of soil before amendments" .format(mix_size, mix_size * GAL_TO_CF)
print "-" * 80

# Amendments need to be added to the living portion of the soil - No Perlite or Lava 
amended_cf = cspm_amnt + humus_amnt + hulls_amnt 

rock_dust_amnt = ROCK_DUST * (amended_cf + air_amnt)
biochar_amnt = BIOCHAR * (amended_cf + air_amnt)

print "\nyou will need to add {} Cubic Feet or {} Gallons of BioChar to the mix ".format(biochar_amnt, biochar_amnt * GAL_TO_CF)
print "\nyou will need to add {} Cups or {} Gallons of Rock Dust to the mix ".format(rock_dust_amnt, rock_dust_amnt/16)

amedned_gal = (mix_size * GAL_TO_CF) + (biochar_amnt * GAL_TO_CF) + (rock_dust_amnt/16)

print "-" * 80
print "You will have {} Cubic Feet or {} Gallons of soil with Rock Dust and BioChar - MOFO 2018" .format(round(amedned_gal / 7.48 ,2) , round(amedned_gal, 2))
print "-" * 80

# Optional Amendments - supposedly no longer needed

print "\nyou can optionally add {} cups of Kelp Meal" .format(amended_cf * KELP)
print "\nyou can optionally add {} cups of Crab Meal" .format(amended_cf * CRAB)
print "\nyou can optionally add {} cups of Neem Meal" .format(amended_cf * NEEM)
print "\nyou can optionally add {} cups of Oyster Meal" .format(amended_cf * OYSTER)
print "\nyou can optionally add {} cups of Alfalfa Meal" .format(amended_cf * ALFALFA)
print "\nyou can optionally add {} cups of Malted Barley Powder" .format(amended_cf * MBP)
print "\nyou can optionally add {} cups of Gypsum Powder" .format(amended_cf * GYPSUM)

optional_amnt = amended_cf * (KELP + CRAB + NEEM + OYSTER + ALFALFA + MBP + GYPSUM)

print "-" * 80
print "optional amendments equal {} cups or {} Gallons" .format(optional_amnt, round(optional_amnt / 16 , 2))
print "=" * 80

final_gal = amedned_gal + (optional_amnt / 16)

print "You will have {} Cubic Feet or {} Gallons of soil @{}% aeration if everything is used.\n" .format(round(final_gal / 7.48, 2) , round(final_gal, 2), aeration)