Skip to main content

Common Mamon11 tools and utilities

Project description

Mamon Utilities

A set of tools and utilities for Python Development

Installation

pip install mamon-utils

Usage

To use any of these modules, just import from mamonutils.

Database

This module makes it easy to connect to our PostgreSQL databases. To use it, you have to add a .env file in the root of your project specifying the following environment variables:

DB_HOST=
DB_PORT=
DB_USER=
DB_PASSWORD=

Example usage:

from mamonutils import Database, dotenv

# Load environment variables
dotenv()

# Connect to clients database
db = Database('clients')
cursor = db.cursor

cursor.execute('SELECT * from clients')
result = cursor.fetchall()
print(result)

# Disconnect
db.disconnect()

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

mamon_utils-0.0.2.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

mamon_utils-0.0.2-py3-none-any.whl (2.2 kB view hashes)

Uploaded Python 3

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