I need to process a bunch of rows from a MySQL database table. I will be using Python as the programming language.


  • Python module
    • reading the rows of an existing database/table
    • data is numeric, datetime, str, etc
    • reading the data returns Python objects/datatypes (i.e. int,float,str,etc,etc. not just a string or multiple strings.)
  • supports MySQL
  • RPM and/or DEB package available
  • open-source
  • the Python module must be actively developed[1]
  • public code repo[2]

Given these requirements, what is a good Python module to access data in MySQL/MariaDB database?

Extra value go towards the following:

  • a project that has positive growth[3]
  • good example code, documentation, tutorials
  • large user base
  • supports MariaDB also (future work may transition from MySQL to MariaDB)

[1] frequent commits (at least one commit per month, preferably one or more commits per week), at least 3 active developers

[2] to allow me to pull down the code via some version control

[3] users/developers/unittests/features/etc of the Python module are growing

  • I found two decent Python modules MySQLdb (sourceforge) and sqlalchemy. However I am not knowledgable about databases. Commented Mar 8, 2017 at 13:41
  • While I am with you that I prefer code that is still being maintained and aupported is better, but isn't that pretty fast? Or are commits different than conpile and publishing? Commented Mar 9, 2017 at 10:53
  • FYI from my brief google research looking into MySQLdb --> MySQLdb appears to be abandoned as of 2014-01-02 Commented Mar 9, 2017 at 16:09

1 Answer 1


Pandas provides a database abstraction layer over SQLAlchemy with a fallback to sqlite.

  • Read the rows of an existing DB - Definitely but conceptually when using pandas dataframes you tend to think in columns data can be read from tables or queries.
  • Data is not text only - Yes: Pandas dataframes contain real, typed, data objects.
  • Support MySQL - Yes via SQLAlchemy
  • Actively Developed - Yes for both Pandas and SQLAlchemy
  • Public code repository: Pandas is on GitHub while SQLAchemy is on BitBucket

Activity as at 27 May 2017:

Pandas: From the GitHub Pulse: In the last month 169 pull requests by 54 Authors impacting 417 files. SQLAchemy: BitBucket doesn't seem to have a pulse tool that I can see but looking at the logs suggests that it is less active but by no means dead with significant activity in the last few hours by multiple authors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.