Skip to content

Auction price guessing game written in Python that also lets users keep images of the artwork they like!

License

Notifications You must be signed in to change notification settings

pre-eth/hammerpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HammerPy

HammerPy is a game where users guess the price of artwork available on auction websites. The name comes from the term "hammer price", which refers to the final selling price of a work. Asking prices are used instead for art that is still available for sale.

Currently the game retrieves artwork from Artsy and Sotheby's, and more sources will hopefully be added in the future.

Setup and Installation

HammerPy requires >= Python 3.8. In order for the Sotheby's integration to work, you need to install a web driver for Chrome, which takes 2 seconds and can be found here.

Dependencies:

  • requests
  • urllib3
  • Pillow
  • beautifulsoup4
  • selenium
pip install -r requirements.txt
python hammer.py

Quickstart

The game is fairly straightforward because it's open ended - enter the price you think is closest to the worth of the displayed artwork. You cannot go backwards after submitting a guess. Once all guesses have been turned in, the game takes you to the results screen where you can view metadata for the artwork including the real price, what the acceptable range of guesses was, and whether you were correct.

All prices are in USD - any works that have prices in foreign currencies are converted to USD for the game.

There are 3 difficulty levels:

  • Easy: +/- 25% from actual price
  • Medium: +/- 15% from actual price
  • Hard: +/- 5% from actual price

Fetching the art might take a while as the bottleneck here is network speed. If the number of requested works is >= 5, then a time.sleep call for 5 seconds is added to avoid spamming the service with requests

HammerPy downloads the images of the art to your computer temporarily for the lifespan of the game. On the results screen, you can decide if you'd like to keep the images for any of the art you like. By default, this is set to False, and any artwork you do not explicitly mark as wanting to keep is REMOVED from your system

Keyboard Navigation

You can traverse the menu without using the mouse! Here are the key bindings:

q - Quit. Control/Command Q work as well.
a - Selects Artsy as the source
s - Selects Sotheby's as the source
ArrowUp/ArrowDown - Cycles through the Medium / Category
ArrowLeft/ArrowRight - Decrements or increments the number of works to retrieve
1 - Sets the difficulty to Easy
2 - Sets the difficulty to Medium
3 - Sets the difficulty to Hard
Return - Starts game

You can also hit Return to advance through the guessing screens.

Screenshots

About

Auction price guessing game written in Python that also lets users keep images of the artwork they like!

Topics

Resources

License

Stars

Watchers

Forks