Database Access

Python comes with a sqlite3 module and can be connected to other Databases by libraries like mysql-python, psycopg2, PyMongo etc. The Libraries like SQLAlchemy, Django ORM helps in implementing ORM.


Databases implemented in Python.

  • pickleDB - A simple and lightweight key-value store for Python.
  • PipelineDB - The Streaming SQL Database.
  • TinyDB - A tiny, document-oriented database.
  • ZODB - A native object database for Python. A key-value and object graph database.

Database Drivers

Libraries for connecting and operating databases.

Relational Databases

  • apsw - Another Python SQLite wrapper.
  • dataset - Store Python dicts in a database - works with SQLite, MySQL, and PostgreSQL.
  • mysql-connector-python - A pure Python MySQL driver from Oracle.
  • mysql-python - The MySQL database connector for Python.
  • mysqlclient - mysql-python fork supporting Python 3.
  • oursql - A better MySQL connector with support for native prepared statements and BLOBs.
  • psycopg2 - The most popular PostgreSQL adapter for Python.
  • PyMySQL - Pure Python MySQL driver compatible to mysql-python.
  • queries - A wrapper of the psycopg2 library for interacting with PostgreSQL.
  • txpostgres - Twisted based asynchronous driver for PostgreSQL.
  • cx_Oracle - The Oracle database connector for Python.
  • pymssql - A simple database interface to Microsoft SQL Server.

NoSQL Databases

  • cassandra-python-driver - Python driver for Cassandra.
  • HappyBase - A developer-friendly library for Apache HBase.
  • Plyvel - A fast and feature-rich Python interface to LevelDB.
  • py2neo - Python wrapper client for Neo4j's restful interface.
  • pycassa - Python Thrift driver for Cassandra.
  • PyMongo - The official Python client for MongoDB.
  • redis-py - The Redis Python Client.
  • telephus - Twisted based client for Cassandra.
  • txRedis - Twisted based client for Redis.


Libraries that implement Object-Relational Mapping or data mapping techniques.

###Relational Databases

NoSQL Databases

  • django-mongodb-engine - Django MongoDB Backend.
  • flywheel - Object mapper for Amazon DynamoDB.
  • MongoEngine - A Python Object-Document-Mapper for working with MongoDB.
  • redisco - A Python Library for Simple Models and Containers Persisted in Redis.


  • butterdb - A Python ORM for Google Drive Spreadsheets.
  • snaql - Raw .QL queries builder and organizer for Python.


The following people helped in creating the above content.