Skip to content

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

License

Notifications You must be signed in to change notification settings

xiaolong2009/DictMySQL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DictMySQL Build Status

PyPI page: https://pypi.python.org/pypi/dictmysql

Documentation: https://ligyxy.github.io/DictMySQL

Introduction

A mysql class on the top of PyMySQL, for more 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='127.0.0.1', user='root', passwd='')

db.select(table='jobs',
          columns=['id','value'],
          where={'$OR': [{'value': {'$LIKE': 'Artist%'}}, {'id': 10}]})
# SELECT `id`, `value` FROM `jobs` WHERE (`value` LIKE "Artist%") OR (`id` = 10);

License

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%