
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
py-postgresql
Advanced tools
.. warning::
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.
py-postgresql is a set of Python modules providing interfaces to various parts of PostgreSQL. Primarily, it provides a pure-Python driver with some C optimizations for querying a PostgreSQL database.
http://github.com/python-postgres/fe
Features:
Sample PG-API Code::
>>> import postgresql
>>> db = postgresql.open('pq://user:password@host:port/database')
>>> db.execute("CREATE TABLE emp (emp_first_name text, emp_last_name text, emp_salary numeric)")
>>> make_emp = db.prepare("INSERT INTO emp VALUES ($1, $2, $3)")
>>> make_emp("John", "Doe", "75,322")
>>> with db.xact():
... make_emp("Jane", "Doe", "75,322")
... make_emp("Edward", "Johnson", "82,744")
...
There is a DB-API 2.0 module as well::
postgresql.driver.dbapi20
However, PG-API is recommended as it provides greater utility.
Once installed, try out the pg_python console script::
$ python3 -m postgresql.bin.pg_python -h localhost -p port -U theuser -d database_name
If a successful connection is made to the remote host, it will provide a Python
console with the database connection bound to the db name.
FAQs
PostgreSQL driver and tools library.
We found that py-postgresql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.