Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A wrapper around MySQLdb to make development of quick scripts easier

Project Description
===========
SimpleDB
===========

SimpleDB aims to provide a wrapper to make writing scripts that do basic queries
a lot easier and faster to write.

Helper functions
=========

Dicts
-------------

* query_dict
* query_dict_row

Truples
-------------

* query_tuple
* query_tuple_row

Lists
-------------

* query_list
* query_list_row

Fields
-------------

* query_fields
* query_field

Usage examples
=========

MySQLdb
-------------

from SimpleDB import MySQLdb

dbh = MySQLdb(user='root', passwd='bleh')

for field in dbh.query_dicts('SELECT col1, col2, col3 FROM table')():
print field
{'col1': 'a', 'col2': 'b', 'col3': 'c'}
{'col1': 'd', 'col2': 'e', 'col3': 'f'}

print dbh.query_dict_row('SELECT col1, col2, col3 FROM table LIMIT 1')
{'col1': 'a', 'col2': 'b', 'col3': 'c'}

for field in dbh.query_tuples('SELECT col1, col2, col3 FROM table')():
print field
('a', 'b', 'c'),
('d', 'e', 'f'),

print dbh.query_tuple_row('SELECT col1, col2, col3 FROM table LIMIT 1')
('a', 'b', 'c')

for field in dbh.query_lists('SELECT col1, col2, col3 FROM table')():
print field
['a', 'b', 'c'],
['d', 'e', 'f'],

print dbh.query_list_row('SELECT col1, col2, col3 FROM table LIMIT 1')
['a', 'b', 'c']

for field in dbh.query_fields('SELECT col1 FROM table')():
print field
'a'
'd'

print dbh.query_field('SELECT col1 FROM table LIMIT 1')
'a'
Release History

Release History

This version
History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SimpleDB-0.0.5.tar.gz (3.9 kB) Copy SHA256 Checksum SHA256 Source Feb 23, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting