1 """A Python driver for PostgreSQL
2
3 psycopg is a PostgreSQL_ database adapter for the Python_ programming
4 language. This is version 2, a complete rewrite of the original code to
5 provide new-style classes for connection and cursor objects and other sweet
6 candies. Like the original, psycopg 2 was written with the aim of being very
7 small and fast, and stable as a rock.
8
9 Homepage: http://initd.org/projects/psycopg2
10
11 .. _PostgreSQL: http://www.postgresql.org/
12 .. _Python: http://www.python.org/
13
14 :Groups:
15 * `Connections creation`: connect
16 * `Value objects constructors`: Binary, Date, DateFromTicks, Time,
17 TimeFromTicks, Timestamp, TimestampFromTicks
18 """
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 import sys, warnings
41 if sys.version_info[0] >= 2 and sys.version_info[1] >= 3:
42 try:
43 import datetime as _psycopg_needs_datetime
44 except:
45 warnings.warn(
46 "can't import datetime module probably needed by _psycopg",
47 RuntimeWarning)
48 if sys.version_info[0] >= 2 and sys.version_info[1] >= 4:
49 try:
50 import decimal as _psycopg_needs_decimal
51 except:
52 warnings.warn(
53 "can't import decimal module probably needed by _psycopg",
54 RuntimeWarning)
55 from psycopg2 import tz
56 del sys, warnings
57
58
59
60 from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
61
62 from _psycopg import Binary, Date, Time, Timestamp
63 from _psycopg import DateFromTicks, TimeFromTicks, TimestampFromTicks
64
65 from _psycopg import Error, Warning, DataError, DatabaseError, ProgrammingError
66 from _psycopg import IntegrityError, InterfaceError, InternalError
67 from _psycopg import NotSupportedError, OperationalError
68
69 from _psycopg import connect, apilevel, threadsafety, paramstyle
70 from _psycopg import __version__
71
72 __all__ = [ k for k in locals().keys() if not k.startswith('_') ]
73