Skip to main content

Wrappers for PostgreSQL interaction using dataframes or dictionaries.

Project description

cheesefactory-database


A wrapper for psycopg2.

PyPI Latest Release PyPI status PyPI download month PyPI download week PyPI download day

Main Features

  • Built on psycopg2.
  • Pandas dataframe support.
  • Test table existence.
  • Test field existence.

Note: This package is still in beta status. As such, future versions may not be backwards compatible and features may change.

Installation

The source is hosted at https://bitbucket.org/hellsgrannies/cheesefactory-database

pip install cheesefactory-database

Dependencies

License

Parameters

class CfPostgres(host: str = 127.0.0.1, port: int = 5432, user: str = None, password: str = None, database: str = None)

Handles the connection to a PostgreSQL database.

  • host: PostgreSQL server hostname/IP.
  • port: PostgreSQL server port.
  • user: Username for authentication.
  • password: Password for authentication.
  • database: Database for connection

Examples

Connect to the remote SFTP server

from cheesefactory-database.postgresql import CfPostgres

# Establish connection
db = CfPostgres(host='myhostname', user='myusername', password='mypassword', database='mydatabase')

# Execute query
results = db.execute("SELECT first_name, last_name FROM person WHERE last_name = 'Smith'")

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

cheesefactory-database-0.8.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file cheesefactory-database-0.8.tar.gz.

File metadata

  • Download URL: cheesefactory-database-0.8.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for cheesefactory-database-0.8.tar.gz
Algorithm Hash digest
SHA256 c3c2b9cd9150c8895583e4d25bf9b9fe825568f4a9c6b514da868210c51391e7
MD5 6f816dacd2545555270cbfd76441811e
BLAKE2b-256 c1021293aa91a574c9924e838301eaf55ecdfd45ecf2d6f21c8c634c19b7b2c2

See more details on using hashes here.

Supported by

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