Giter Site home page Giter Site logo

mustafamado / fe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from python-postgres/fe

0.0 0.0 0.0 5.25 MB

py-postgresql: Access and query a PostgreSQL database with Python 3.

License: BSD 3-Clause "New" or "Revised" License

Python 92.51% C 7.49%

fe's Introduction

About

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

For a high performance async interface, MagicStack's asyncpg http://github.com/MagicStack/asyncpg should be considered.

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

Advisory

In v1.3, postgresql.driver.dbapi20.connect will now raise ClientCannotConnectError directly. Exception traps around connect should still function, but the __context__ attribute on the error instance will be None in the usual failure case as it is no longer incorrectly chained. Trapping ClientCannotConnectError ahead of Error should allow both cases to co-exist in the event that data is being extracted from the ClientCannotConnectError.

In v2.0, support for older versions of PostgreSQL and Python will be removed.
If you have automated installations using PyPI, make sure that they specify a major version.

Installation

Using PyPI.org:

$ pip install py-postgresql

From a clone:

$ git clone https://github.com/python-postgres/fe.git
$ cd fe
$ python3 ./setup.py install # Or use in-place without installation(PYTHONPATH).

Basic Usage

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)

Documentation

http://py-postgresql.readthedocs.io

Related

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.