Bazaar lets you run online auction drafts (as in fantasy sports). It is primarily designed for drafting Magic: the Gathering cubes, but can be adapted for any kind of auction draft.
- Python 3.6+
- Navigate to the project directory. Then run the following commands to create a virtual environment with the necessary packages.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Replace
cube_list.txt
with your cube list (one card per line). - Build a folder of card images by running
python fetch_images.py
. This will take about one minute per 100 cards. - Initialize the database with
flask db upgrade
. - Bazaar supports custom cards. However,
cube_list.txt
must only contain real card names. To implement custom cards, ensure there is a unique "placeholder" card name incube_list.txt
for each custom card. Then, create a file calledcustom_cards.txt
with a list ofplaceholder_cardname -> custom_cardname
, one per line. Then, place images for your custom cards in theapp/static/card_images
directory. The image names must be the custom card names with all non-alphanumeric characters removed and must end in.jpg
(e.g.,CustomCardname7.jpg
).
- Run
python bazaar.py
. - By default, you can access Bazaar on port 5000. If you are running Bazaar on your computer and not a publically accessible server, you can use ngrok to allow drafters to connect. It creates a web address for a given port on your computer and there are easy-to-follow instructions on its website.
- After creating an account, any user can create a draft from the
New Draft
page. They become the owner of that draft. There are a number of configurable options:Starting Balance
sets the amount of currency that each drafter begins with.Default Lot Size
controls how many cards appear in each lot. During a draft, the owner of that draft may nominate a particular card to be the next lot. This can be done for the first lot withFirst Nomination
.Time Limit
is currently unenforced except that the clock changes color when it has passed. The owner of the auction can manually close bidding to enforce the limit (or at any time).
- After each player has placed a bid, the bids and winner are displayed and the lot is added to the winner's pool. The owner of the draft must click a button to advance to the next lot (to allow drafters time to see the outcome).
- Each player's currency balance is visible to everyone else on the draft page. Each player's pool of cards that they have won is visible at all times on pages linked from the draft page.
- The draft is complete when no player has any currency left, the pool of cards has been exhausted, or (most commonly) by stopping after a pre-designated number of lots.
- If two players bid the same amount, the player who submitted their bid first wins the lot.
- Players who have already bid on a lot can submit another bid to change their bid. The most recent bid from each player is used. (Bidding closes when every player has submitted a bid or if the auction owner closes it manually before then.)
Contributions are warmly welcomed. Report bugs using the issue tracker. To contribute code, submit a pull request.
Distributed under the MIT License. See LICENSE for more information.
Miguel Grinberg's Flask Mega-Tutorial was instrumental in the creation of Bazaar.
Bazaar uses the wonderful Scryfall API.