CherryPy-Psycopg2
CherryPy-Psycopg2 is a simple CherryPy Tool to manage a (thread-safe) pool of database connections and make them available to handlers.
Import cherrypy_psycopg2 to make the tool available in CherryPy's default toolbox.
The following configuration settings are understood:
tools.psycopg2.minconn- passed to the psycopg2 pool constructortools.psycopg2.maxconn- passed to the psycopg2 pool constructortools.psycopg2.dsn- passed to the psycopg2 pool constructortools.psycopg2.cursor_factory- passed to the psycopg2 connection's cursor() method
When the tool is enabled on a handler, it will collect a database connection
from the pool, expose a cursor as cherrypy.request.psycopg2_cursor,
execute the handler and then commit the transaction (if the handler was
successful or raised one of the
cherrypy_psycopg2.COMMITTABLE_HANDLER_EXCEPTIONS), or rollback the
transaction if the handler raised any other exception.
For example:
class Root:
@cherrypy.expose
@cherrypy.tools.psycopg2()
def index(self):
cursor = cherrypy.request.psycopg2_cursor
cursor.execute("SELECT now()")
return cursor.fetchone()[0]
Metadata
Release files for cherrypy-psycopg2 2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cherrypy-psycopg2-2.0.tar.gz | 7.5 kB | Without provenance | Details for cherrypy-psycopg2-2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cherrypy_psycopg2-2.0-py3-none-any.whl | Python 3 | none | any | Details for cherrypy_psycopg2-2.0-py3-none-any.whl |
Total release size: 14.8 kB
Release files / cherrypy-psycopg2-2.0.tar.gz
| Download URL | cherrypy-psycopg2-2.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d96a6702094a0d0544607e922c1f85461ec414fe71b8fe52b4b354e89d785b9
|
|
BLAKE2b-256 checksum How to use checksums |
f733bce54a7d0c9792c1e5573aa26d0748c1c409753eb77e26db974ab4c83c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.9
|
Release files / cherrypy_psycopg2-2.0-py3-none-any.whl
| Download URL | cherrypy_psycopg2-2.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3b1738286ca20001697586c4c782f8578eb2e40a776aae179a3e5f24d6f94ee
|
|
BLAKE2b-256 checksum How to use checksums |
eff6d38a0127511581db05150c00e9217290856f72575379b49b0d7229bd7dec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.9
|
Security for cherrypy-psycopg2 2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.