Skip to content

Commit 7be3e16

Browse files
committed
Merge branch 'master' into fix_w32
2 parents acea988 + 8775f70 commit 7be3e16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1076
-761
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*.{py,c}]
4+
indent_style = tab
5+
indent_size = tab
6+
tab_width = 4

AUTHORS

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Contributors:
2-
James William Pye [faults are mostly mine] <[email protected]>
2+
James William Pye [faults are mostly mine]
33
Elvis Pranskevichus
44
William Grzybowski [subjective paramstyle]
55
Barry Grussling [inet/cidr support]
@@ -8,13 +8,8 @@ Contributors:
88
Support by Donation:
99
AppCove Network
1010

11-
Further Credits
12-
===============
13-
14-
When licenses match, people win. Code is occasionally imported from other
15-
projects to enhance py-postgresql and to allow users to enjoy dependency free
16-
installation.
17-
11+
Imported
12+
========
1813

1914
DB-API 2.0 Test Case
2015
--------------------

LICENSE

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
BSD Licensed Software
2-
3-
Unless stated otherwise, the contained software is
4-
copyright 2004-2009, James Williame Pye.
5-
For more information: http://python.projects.postgresql.org
6-
7-
81
Redistribution and use in source and binary forms,
92
with or without modification, are permitted provided
103
that the following conditions are met:

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ recursive-include postgresql *.c
44
recursive-include postgresql *.sql
55
recursive-include postgresql *.txt
66
recursive-include postgresql/documentation/sphinx *.rst conf.py
7-
recursive-include postgresql/documentation/html *

README

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
### About
2+
3+
py-postgresql is a Python 3 package providing modules for working with PostgreSQL.
4+
Primarily, a high-level driver for querying databases.
5+
6+
For a high performance async interface, MagicStack's asyncpg
7+
http://github.com/MagicStack/asyncpg should be considered.
8+
9+
py-postgresql, currently, does not have direct support for high-level async
10+
interfaces provided by recent versions of Python. Future versions may change this.
11+
12+
### Advisory
13+
14+
In v1.3, `postgresql.driver.dbapi20.connect` will now raise `ClientCannotConnectError` directly.
15+
Exception traps around connect should still function, but the `__context__` attribute
16+
on the error instance will be `None` in the usual failure case as it is no longer
17+
incorrectly chained. Trapping `ClientCannotConnectError` ahead of `Error` should
18+
allow both cases to co-exist in the event that data is being extracted from
19+
the `ClientCannotConnectError`.
20+
21+
In v2.0, support for older versions of PostgreSQL and Python will be removed.
22+
If you have automated installations using PyPI, make sure that they specify a major version.
23+
24+
### Installation
25+
26+
Using PyPI.org:
27+
28+
$ pip install py-postgresql
29+
30+
From a clone:
31+
32+
$ git clone https://github.com/python-postgres/fe.git
33+
$ cd fe
34+
$ python3 ./setup.py install # Or use in-place without installation(PYTHONPATH).
35+
36+
### Basic Usage
37+
38+
```python
39+
import postgresql
40+
db = postgresql.open('pq://user:password@host:port/database')
41+
42+
get_table = db.prepare("SELECT * from information_schema.tables WHERE table_name = $1")
43+
print(get_table("tables"))
44+
45+
# Streaming, in a transaction.
46+
with db.xact():
47+
for x in get_table.rows("tables"):
48+
print(x)
49+
```
50+
51+
### Documentation
52+
53+
http://py-postgresql.readthedocs.io
54+
55+
### Related
56+
57+
- http://postgresql.org
58+
- http://python.org

postgresql/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
##
22
# py-postgresql root package
3-
# http://python.projects.postgresql.org
3+
# http://github.com/python-postgres/fe
44
##
55
"""
66
py-postgresql is a Python package for using PostgreSQL. This includes low-level
7-
protocol tools, a driver(PG-API and DB-API), and cluster management tools.
7+
protocol tools, a driver(PG-API and DB-API 2.0), and cluster management tools.
88
9-
If it's not documented in the narratives, `postgresql.documentation.index`, then
10-
the stability of the APIs should *not* be trusted.
11-
12-
See <http://postgresql.org> for more information about PostgreSQL.
9+
See <http://postgresql.org> for more information about PostgreSQL and <http://python.org>
10+
for information about Python.
1311
"""
1412
__all__ = [
1513
'__author__',

0 commit comments

Comments
 (0)