Metadata-Version: 2.4
Name: py-postgresql
Version: 1.3.1
Summary: Query PostgreSQL databases using Python and the PQv3 protocol.
Home-page: http://github.com/python-postgres/fe
Author: James William Pye
Author-email: James William Pye <james.pye@gmail.com>
Maintainer: James William Pye
Maintainer-email: James William Pye <james.pye@gmail.com>
License: Redistribution and use in source and binary forms,
        with or without modification, are permitted provided
        that the following conditions are met:
        
          Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
        
          Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
        
          Neither the name of the James William Pye nor the names of [its]
          contributors may be used to endorse or promote products derived
          from this software without specific prior written permission.
        
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
        "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
        FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
        COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
        BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
        LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
        STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
        IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
        POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Documentation, http://py-postgresql.readthedocs.io
Project-URL: Issues, https://github.com/python-postgres/fe/issues
Project-URL: Source, https://github.com/python-postgres/fe
Keywords: syncpg,postgres,postgresql,sql,driver
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Attribution Assurance License
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: maintainer
Dynamic: requires-python

### About

py-postgresql is a Python 3 package providing modules for working with PostgreSQL.
Primarily, a high-level driver for querying databases.

While py-postgresql is still usable for many purposes, asyncpg and PostgREST are
likely more suitable for most applications:

- https://github.com/MagicStack/asyncpg
- https://postgrest.org

py-postgresql, currently, does not have direct support for high-level async
interfaces provided by recent versions of Python. Future versions may change this.

- [Project Future](https://github.com/python-postgres/fe/issues/124)

### Advisory

In v2.0, many, potentially breaking, changes are planned.
If you have automated installations using PyPI, make sure that they specify a major version.

- Support for older versions of PostgreSQL and Python will be removed. This will allow the driver
to defer version parsing fixing (https://github.com/python-postgres/fe/issues/109), and better prepare for future versions.
- The connection establishment strategy will be simplified to only performing one attempt. `sslmode`
parameter should be considered deprecated. v1.4 will provide a new security parameter implying `sslmode=require`. See (https://github.com/python-postgres/fe/issues/122) and (https://github.com/python-postgres/fe/issues/75).
- StoredProcedure will be removed. See (https://github.com/python-postgres/fe/issues/80).

### Installation

From [PyPI](https://PyPI.org) using `pip`:

```bash
python3 -m pip install py-postgresql
```

From [GitHub](https://github.com) using a full clone:

```bash
git clone https://github.com/python-postgres/fe.git
cd fe
python3 ./setup.py install
```

### Basic Usage

```python
import postgresql
db = postgresql.open('pq://user:password@host:port/database')

get_table = db.prepare("SELECT * from information_schema.tables WHERE table_name = $1")
print(get_table("tables"))

# Streaming, in a transaction.
with db.xact():
	for x in get_table.rows("tables"):
		print(x)
```

REPL with connection bound to `db` builtin:

```bash
python3 -m postgresql.bin.pg_python -I 'pq://postgres@localhost:5423/postgres'
```

### Documentation

- https://py-postgresql.readthedocs.io
- https://github.com/python-postgres/fe/issues?q=label%3Ahowto

### Related

- https://postgresql.org
- https://python.org
