Skip to main content

Provide an Abstract Base Class for PEP249 compliant databases

Project description

dbapi2abc

This package provides abstract classes to present an interface to PEP249 compliant database Connection and Cursor objects.

This allows you to use type hints on functions handling database connections and cursors without needing to specify the specific backend database engine being used.

from dbapi2abc import Connection, Cursor

class MyObject():
    def __init__(self, db: Connection):
        self.db = db

    def run_some_query(self) -> Cursor:
        cur = self.db.cursor()
        cur.execute("SELECT * FROM Table")
        return cur

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbapi2abc-1.1.1.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file dbapi2abc-1.1.1.tar.gz.

File metadata

  • Download URL: dbapi2abc-1.1.1.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.2

File hashes

Hashes for dbapi2abc-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2a7b0736495a76cc2fcca13ccd29d2da84c44396d53b51f5f3785f7a622dfc4a
MD5 c9bd01ba656f8854db8c8cabf8540c12
BLAKE2b-256 61424314f2de928f36c2546f151fa36e6842f455d19af0e0de9c95435d0bf0b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page