MySQLdb (version 1.2.1_p2)
index
MySQLdb/__init__.py

MySQLdb - A DB API v2.0 compatible interface to MySQL.
 
This package is a wrapper around _mysql, which mostly implements the
MySQL C API.
 
connect() -- connects to server
 
See the C API specification and the MySQL documentation for more info
on other items.
 
For information on how MySQLdb handles type conversion, see the
MySQLdb.converters module.

 
Package Contents
       
connections
constants (package)
converters
cursors
release
times

 
Classes
       
__builtin__.object
datetime.date
datetime.datetime
datetime.time
exceptions.StandardError(exceptions.Exception)
_mysql_exceptions.MySQLError
_mysql_exceptions.Error
_mysql_exceptions.DatabaseError
_mysql_exceptions.DataError
_mysql_exceptions.IntegrityError
_mysql_exceptions.InternalError
_mysql_exceptions.NotSupportedError
_mysql_exceptions.OperationalError
_mysql_exceptions.ProgrammingError
_mysql_exceptions.InterfaceError
_mysql_exceptions.Warning(exceptions.Warning, _mysql_exceptions.MySQLError)
exceptions.Warning(exceptions.Exception)
_mysql_exceptions.Warning(exceptions.Warning, _mysql_exceptions.MySQLError)
sets.ImmutableSet(sets.BaseSet)
DBAPISet

 
class DBAPISet(sets.ImmutableSet)
    A special type of set for which A == x is true if A is a
DBAPISet and x is a member of that set.
 
 
Method resolution order:
DBAPISet
sets.ImmutableSet
sets.BaseSet
__builtin__.object

Methods defined here:
__eq__(self, other)
__ne__(self, other)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'DBAPISet' objects>
list of weak references to the object (if defined)

Methods inherited from sets.ImmutableSet:
__getstate__(self)
__hash__(self)
__init__(self, iterable=None)
Construct an immutable set from an optional iterable.
__setstate__(self, state)

Data and other attributes inherited from sets.ImmutableSet:
__slots__ = ['_hashcode']

Methods inherited from sets.BaseSet:
__and__(self, other)
Return the intersection of two sets as a new set.
 
(I.e. all elements that are in both sets.)
__cmp__(self, other)
__contains__(self, element)
Report whether an element is a member of a set.
 
(Called in response to the expression `element in self'.)
__copy__ = copy(self)
Return a shallow copy of a set.
__deepcopy__(self, memo)
Return a deep copy of a set; used by copy module.
__ge__ = issuperset(self, other)
Report whether this set contains another set.
__gt__(self, other)
__iter__(self)
Return an iterator over the elements or a set.
 
This is the keys iterator for the underlying dict.
__le__ = issubset(self, other)
Report whether another set contains this set.
__len__(self)
Return the number of elements of a set.
__lt__(self, other)
__or__(self, other)
Return the union of two sets as a new set.
 
(I.e. all elements that are in either set.)
__repr__(self)
Return string representation of a set.
 
This looks like 'Set([<list of elements>])'.
__str__ = __repr__(self)
Return string representation of a set.
 
This looks like 'Set([<list of elements>])'.
__sub__(self, other)
Return the difference of two sets as a new Set.
 
(I.e. all elements that are in this set and not in the other.)
__xor__(self, other)
Return the symmetric difference of two sets as a new set.
 
(I.e. all elements that are in exactly one of the sets.)
copy(self)
Return a shallow copy of a set.
difference(self, other)
Return the difference of two sets as a new Set.
 
(I.e. all elements that are in this set and not in the other.)
intersection(self, other)
Return the intersection of two sets as a new set.
 
(I.e. all elements that are in both sets.)
issubset(self, other)
Report whether another set contains this set.
issuperset(self, other)
Report whether this set contains another set.
symmetric_difference(self, other)
Return the symmetric difference of two sets as a new set.
 
(I.e. all elements that are in exactly one of the sets.)
union(self, other)
Return the union of two sets as a new set.
 
(I.e. all elements that are in either set.)

 
class DataError(DatabaseError)
    Exception raised for errors that are due to problems with the
processed data like division by zero, numeric value out of range,
etc.
 
 
Method resolution order:
DataError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class DatabaseError(Error)
    Exception raised for errors that are related to the
database.
 
 
Method resolution order:
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
Date = class date(__builtin__.object)
    date(year, month, day) --> date object
 
  Methods defined here:
__add__(...)
x.__add__(y) <==> x+y
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__radd__(...)
x.__radd__(y) <==> y+x
__reduce__(...)
__reduce__() -> (cls, state)
__repr__(...)
x.__repr__() <==> repr(x)
__rsub__(...)
x.__rsub__(y) <==> y-x
__str__(...)
x.__str__() <==> str(x)
__sub__(...)
x.__sub__(y) <==> x-y
ctime(...)
Return ctime() style string.
isocalendar(...)
Return a 3-tuple containing ISO year, week number, and weekday.
isoformat(...)
Return string in ISO 8601 format, YYYY-MM-DD.
isoweekday(...)
Return the day of the week represented by the date.
Monday == 1 ... Sunday == 7
replace(...)
Return date with new specified fields.
strftime(...)
format -> strftime() style string.
timetuple(...)
Return time tuple, compatible with time.localtime().
toordinal(...)
Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.
weekday(...)
Return the day of the week represented by the date.
Monday == 0 ... Sunday == 6

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
day = <attribute 'day' of 'datetime.date' objects>
fromordinal = <built-in method fromordinal of type object>
int -> date corresponding to a proleptic Gregorian ordinal.
fromtimestamp = <built-in method fromtimestamp of type object>
timestamp -> local date from a POSIX timestamp (like time.time()).
max = datetime.date(9999, 12, 31)
min = datetime.date(1, 1, 1)
month = <attribute 'month' of 'datetime.date' objects>
resolution = datetime.timedelta(1)
today = <built-in method today of type object>
Current date or datetime:  same as self.__class__.fromtimestamp(time.time()).
year = <attribute 'year' of 'datetime.date' objects>

 
class Error(MySQLError)
    Exception that is the base class of all other error exceptions
(not Warning).
 
 
Method resolution order:
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class IntegrityError(DatabaseError)
    Exception raised when the relational integrity of the database
is affected, e.g. a foreign key check fails, duplicate key,
etc.
 
 
Method resolution order:
IntegrityError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class InterfaceError(Error)
    Exception raised for errors that are related to the database
interface rather than the database itself.
 
 
Method resolution order:
InterfaceError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class InternalError(DatabaseError)
    Exception raised when the database encounters an internal
error, e.g. the cursor is not valid anymore, the transaction is
out of sync, etc.
 
 
Method resolution order:
InternalError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class MySQLError(exceptions.StandardError)
    Exception related to operation with MySQL.
 
 
Method resolution order:
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class NotSupportedError(DatabaseError)
    Exception raised in case a method or database API was used
which is not supported by the database, e.g. requesting a
.rollback() on a connection that does not support transaction or
has transactions turned off.
 
 
Method resolution order:
NotSupportedError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class OperationalError(DatabaseError)
    Exception raised for errors that are related to the database's
operation and not necessarily under the control of the programmer,
e.g. an unexpected disconnect occurs, the data source name is not
found, a transaction could not be processed, a memory allocation
error occurred during processing, etc.
 
 
Method resolution order:
OperationalError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
class ProgrammingError(DatabaseError)
    Exception raised for programming errors, e.g. table not found
or already exists, syntax error in the SQL statement, wrong number
of parameters specified, etc.
 
 
Method resolution order:
ProgrammingError
DatabaseError
Error
MySQLError
exceptions.StandardError
exceptions.Exception

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
Time = class time(__builtin__.object)
    time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object
 
All arguments are optional. tzinfo may be None, or an instance of
a tzinfo subclass. The remaining arguments may be ints or longs.
 
  Methods defined here:
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__nonzero__(...)
x.__nonzero__() <==> x != 0
__reduce__(...)
__reduce__() -> (cls, state)
__repr__(...)
x.__repr__() <==> repr(x)
__str__(...)
x.__str__() <==> str(x)
dst(...)
Return self.tzinfo.dst(self).
isoformat(...)
Return string in ISO 8601 format, HH:MM:SS[.mmmmmm][+HH:MM].
replace(...)
Return time with new specified fields.
strftime(...)
format -> strftime() style string.
tzname(...)
Return self.tzinfo.tzname(self).
utcoffset(...)
Return self.tzinfo.utcoffset(self).

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
hour = <attribute 'hour' of 'datetime.time' objects>
max = datetime.time(23, 59, 59, 999999)
microsecond = <attribute 'microsecond' of 'datetime.time' objects>
min = datetime.time(0, 0)
minute = <attribute 'minute' of 'datetime.time' objects>
resolution = datetime.timedelta(0, 0, 1)
second = <attribute 'second' of 'datetime.time' objects>
tzinfo = <attribute 'tzinfo' of 'datetime.time' objects>

 
Timestamp = class datetime(date)
    datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
 
The year, month and day arguments are required. tzinfo may be None, or an
instance of a tzinfo subclass. The remaining arguments may be ints or longs.
 
 
Method resolution order:
datetime
date
__builtin__.object

Methods defined here:
__add__(...)
x.__add__(y) <==> x+y
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__radd__(...)
x.__radd__(y) <==> y+x
__reduce__(...)
__reduce__() -> (cls, state)
__repr__(...)
x.__repr__() <==> repr(x)
__rsub__(...)
x.__rsub__(y) <==> y-x
__str__(...)
x.__str__() <==> str(x)
__sub__(...)
x.__sub__(y) <==> x-y
astimezone(...)
tz -> convert to local time in new timezone tz
ctime(...)
Return ctime() style string.
date(...)
Return date object with same year, month and day.
dst(...)
Return self.tzinfo.dst(self).
isoformat(...)
[sep] -> string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM].
 
sep is used to separate the year from the time, and defaults to 'T'.
replace(...)
Return datetime with new specified fields.
time(...)
Return time object with same time but with tzinfo=None.
timetuple(...)
Return time tuple, compatible with time.localtime().
timetz(...)
Return time object with same time and tzinfo.
tzname(...)
Return self.tzinfo.tzname(self).
utcoffset(...)
Return self.tzinfo.utcoffset(self).
utctimetuple(...)
Return UTC time tuple, compatible with time.localtime().

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
combine = <built-in method combine of type object>
date, time -> datetime with same date and time fields
fromtimestamp = <built-in method fromtimestamp of type object>
timestamp[, tz] -> tz's local time from POSIX timestamp.
hour = <attribute 'hour' of 'datetime.datetime' objects>
max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
microsecond = <attribute 'microsecond' of 'datetime.datetime' objects>
min = datetime.datetime(1, 1, 1, 0, 0)
minute = <attribute 'minute' of 'datetime.datetime' objects>
now = <built-in method now of type object>
[tz] -> new datetime with tz's local day and time.
resolution = datetime.timedelta(0, 0, 1)
second = <attribute 'second' of 'datetime.datetime' objects>
tzinfo = <attribute 'tzinfo' of 'datetime.datetime' objects>
utcfromtimestamp = <built-in method utcfromtimestamp of type object>
timestamp -> UTC datetime from a POSIX timestamp (like time.time()).
utcnow = <built-in method utcnow of type object>
Return a new datetime representing UTC day and time.

Methods inherited from date:
isocalendar(...)
Return a 3-tuple containing ISO year, week number, and weekday.
isoweekday(...)
Return the day of the week represented by the date.
Monday == 1 ... Sunday == 7
strftime(...)
format -> strftime() style string.
toordinal(...)
Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.
weekday(...)
Return the day of the week represented by the date.
Monday == 0 ... Sunday == 6

Data and other attributes inherited from date:
day = <attribute 'day' of 'datetime.date' objects>
fromordinal = <built-in method fromordinal of type object>
int -> date corresponding to a proleptic Gregorian ordinal.
month = <attribute 'month' of 'datetime.date' objects>
today = <built-in method today of type object>
Current date or datetime:  same as self.__class__.fromtimestamp(time.time()).
year = <attribute 'year' of 'datetime.date' objects>

 
class Warning(exceptions.Warning, MySQLError)
    Exception raised for important warnings like data truncations
while inserting, etc.
 
 
Method resolution order:
Warning
exceptions.Warning
exceptions.Exception
MySQLError
exceptions.StandardError

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
Functions
       
Binary(x)
Connect(*args, **kwargs)
Factory function for connections.Connection.
Connection = Connect(*args, **kwargs)
Factory function for connections.Connection.
DateFromTicks(ticks)
Convert UNIX ticks into a date instance.
TimeFromTicks(ticks)
Convert UNIX ticks into a time instance.
TimestampFromTicks(ticks)
Convert UNIX ticks into a datetime instance.
connect = Connect(*args, **kwargs)
Factory function for connections.Connection.
debug(...)
Does a DBUG_PUSH with the given string.
mysql_debug() uses the Fred Fish debug library.
To use this function, you must compile the client library to
support debugging.
escape(...)
escape(obj, dict) -- escape any special characters in object obj
using mapping dict to provide quoting functions for each type.
Returns a SQL literal string.
escape_dict(...)
escape_sequence(d, dict) -- escape any special characters in
dictionary d using mapping dict to provide quoting functions for each type.
Returns a dictionary of escaped items.
escape_sequence(...)
escape_sequence(seq, dict) -- escape any special characters in sequence
seq using mapping dict to provide quoting functions for each type.
Returns a tuple of escaped items.
escape_string(...)
escape_string(s) -- quote any SQL-interpreted characters in string s.
 
Use connection.escape_string(s), if you use it at all.
_mysql.escape_string(s) cannot handle character sets. You are
probably better off using connection.escape(o) instead, since
it will escape entire sequences as well as strings.
get_client_info(...)
get_client_info() -- Returns a string that represents
the client library version.
string_literal(...)
string_literal(obj) -- converts object obj into a SQL string literal.
This means, any special SQL characters are escaped, and it is enclosed
within single quotes. In other words, it performs:
 
"'%s'" % escape_string(str(obj))
 
Use connection.string_literal(obj), if you use it at all.
_mysql.string_literal(obj) cannot handle character sets.

 
Data
        BINARY = DBAPISet([249, 250, 251, 252])
DATE = DBAPISet([10, 14])
NULL = 'NULL'
NUMBER = DBAPISet([0, 1, 3, 4, 5, 8, 9, 13])
ROWID = DBAPISet([])
STRING = DBAPISet([253, 254, 247])
TIME = DBAPISet([11])
TIMESTAMP = DBAPISet([12, 7])
__all__ = ['BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'Date', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks', 'DataError', 'DatabaseError', 'Error', 'FIELD_TYPE', 'IntegrityError', 'InterfaceError', 'InternalError', 'MySQLError', 'NULL', ...]
__author__ = 'Andy Dustman <[email protected]>'
__revision__ = '410'
__version__ = '1.2.1_p2'
apilevel = '2.0'
paramstyle = 'format'
threadsafety = 1
version_info = (1, 2, 1, 'final', 2)

 
Author
        Andy Dustman <[email protected]>