Skip to content

Instantly share code, notes, and snippets.

@brandonhimpfen
Created April 24, 2026 03:42
Show Gist options
  • Select an option

  • Save brandonhimpfen/c08759920edebc7eacb29478638c3ce4 to your computer and use it in GitHub Desktop.

Select an option

Save brandonhimpfen/c08759920edebc7eacb29478638c3ce4 to your computer and use it in GitHub Desktop.
Python script that you may run at the command line to determine the selling price of a photography print.

You can run this script from the command line by entering the required input values as arguments. For example, to calculate the price of a 16x20 inch photographic print from a limited edition of 50, with a reputation factor of 1.5, production cost of $200, subject value of 0, and a framing cost of $200, you would run the script like this:

python print_price.py 16 50 1.5 200 200 0

The output should be $840.80

import argparse
# Define the command-line arguments
parser = argparse.ArgumentParser(description="Calculate the price of a photographic print")
parser.add_argument("size", type=float, help="The size of the print in inches")
parser.add_argument("edition_size", type=int, help="The size of the limited edition")
parser.add_argument("reputation_factor", type=float, help="The reputation factor of the photographer")
parser.add_argument("production_cost", type=float, help="The production cost of the print in dollars")
parser.add_argument("framing_cost", type=float, help="The framing cost of the print in dollars")
parser.add_argument("subject_value", type=float, help="The subject value multiplier")
args = parser.parse_args()
# Calculate the price of the print using the modified formula
price = ((args.size * args.size) / 144) * (1 + (0.1 * (args.size - 10))) * (1 + (0.2 * (args.edition_size - 1)))
price *= args.subject_value * args.reputation_factor
price += args.production_cost + args.framing_cost
# Print the calculated price
print("${:.2f}".format(price))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment