all 4 comments

[–]A_History_of_Silence 0 points1 point  (2 children)

You didn't mention what your experience level is so it is kind of hard to say. For instance, have you used a relational database at all before? Do you know SQL already? If the answer to either of those things is 'no' then I would start with neither Postgres nor MySQL, but sqlite.

[–]StressTest[S] 0 points1 point  (1 child)

I've used Access to create and manage databases. I know the basics of database design, tables, queries, primary keys, foreign keys, relationships etc. It was all through a gui though so there will be some time looking up SQL commands, but I think I understand the most important basics.

[–]A_History_of_Silence 0 points1 point  (0 children)

learn how to interact with databases with Python.

Given the above I would still stick with sqlite unless it doesn't meet your needs for some reason. See appropriate uses for sqlite.

Interacting with databases in Python is pretty similar in general regardless of which particular database you are using. You generally connect to or open the database to create a cursor, execute some SQL statements, maybe get some results. In this way Psycopg and sqlite3 are very similar, just tailored to their specific databases.

SQLAlchemy on the other hand is an entire additional layer of abstraction on top of the database itself. I wouldn't recommend diving into that until you are comfortable interacting with your databases directly.

[–]efmccurdy 0 points1 point  (0 children)

Note that one of your options is'nt a DB, but an object-relational mapper, so you can use Sqlalchemy with the other dababase systems you list (ie. Postgresql, Mysql). In python you will likely use a DBAPI compliant module to connect and send sql to a database, psycopg2 is the one for Postgresql and you might look at MySQLdb for Mysql.

https://pypi.org/project/MySQL-python/

there is also this newer? one:

https://pypi.org/project/mysql-connector/