Home mtgDB


this project was developed for an university exam.

A Magic The Gathering database manager

Use PyMongo for the connection to the MongoDB database and Pandas to print the results

Source code available here


  • Install MongoDB
  • Install Python
  • Install Pymongo: pip install pymongo
  • Install Pandas: pip install pandas


Work on all Operative Systems

  • Start MongoDB service: service mongod start
  • Move to the /mtgb directory
  • Run: python3 mtgdb.py


0 Exit

1 Load database

2 Count cards in the database

3 Add a new card

4 Remove existing card

5 Search card by name

6 Filter cards by maximum mana cost and color

7 Retrieves the top 5 cards by power

8 Find card from description

9 Check card legalities in a certain format

10 Drop database

This post is licensed under CC BY 4.0 by the author.