Skip to main content

A MySQL class for more convenient database manipulations with Python dictionary.

Project description

PyPI page:



DictMySQL is a MySQL query builder on the top of PyMySQL. It allows convenient database manipulation with Python dictionary.

DictMySQL simplifies and unifies the input/output of MySQL queries, by allowing passing values and conditions in dictionary into database. With DictCursor, you can even have a dict-in, dict-out mysql connector.

To install:

pip install dictmysql

Quick example:

from dictmysql import DictMySQL
db = DictMySQL(db='occupation', host='', user='root', passwd='')'jobs',
          where={'$OR': [{'value': {'$LIKE': 'Artist%'}}, {'id': 10}]})
# SELECT `id`, `value` FROM `jobs` WHERE (`value` LIKE "Artist%") OR (`id` = 10);

With DictCursor:

from dictmysql import DictMySQL, cursors
db = DictMySQL(db='occupation', host='', user='root', passwd='',
# returns [{u'id': 1, u'value': u'Artist'}, {u'id': 2, u'value': u'Engineer'}]

Future Works

  1. Full support of CRUD

  2. Better documents


DictMySQL uses the MIT license, see LICENSE file for the details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dictmysql-0.6.8.tar.gz (7.8 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page