4

#include <helpme>

Ok guys I kinda need your help. I have to write a python project for my school in 3 days and instead of saving everything in files I want to have a database. So my question is can you suggest the most simplest and easiest db to create and connect to Python for a few simple tables. Also the easiest to set up on another computer since my professor will probably want to try it at home.

Also I have to learn Python in 3 days, since I already know a couple of languages, I'm confident I can pull it off. Why I'm asking for help is I need to document it all, that will probably take a chunk out of these 3 days.

Comments
  • 5
    SQLite, nothing to install, nothing to manage, acts like a database, but uses just files you can transfer to any other computer.

    And you can change to a real database any time you want.

    If you absolutely want a database, use MySQL, it's easy to install, but there is a bit of setup and management needed before you can get started. That can be a bit of a hassle if someone else has to have the same environment set up by his own.
  • 0
    @ddephor thanks, I'll give it a look
  • 1
    You can learn about sqlite from the official docs:
    https://docs.python.org/2.7/... (Python2)
    https://docs.python.org/3/library/... (Python3)
  • 0
    @thewanderer ok cool, I got it from here. Thanks for the help guys :)
  • 1
    Either use native sqlite or a look at Dataset:
    https://dataset.readthedocs.io/en/...
    It is based on the universal SQLAlchemy Library but does most things for you automatically.
    If you don't have a Database it even creates one for you.
    And it connects to nearly every DBMS you would want to use.
    Also dataset transforms the database into a nice object oriented structure to work with in your script.

    If you need more functionality you can always run SQLAlchemy commands over Dataset.

    For development, I would recommend sqlite-backend with dataset, because Dataset simply creates the sqlite-.db file for you.
    Later you can switch to any other DBMS by changing a single line at the top of your sourcecode.
Add Comment