Skip to main content

A module to fetch data from MySQL db as list or save it as text file

Project description

This package using MySQLdb interface to connect to database. This module will give convenience to fetch data as list (fetch_dbdata_list) and export it to text file (write_dbdata_file), or do all in 1 go using fetch_dbdata_file.

CONTENTS:

def fetch_dbdata_file(sql, db_credential, output_filename, mode=”w”, delimiter=”t”) # all in one def fetch_dbdata_list(sql, db_credential, header=True) def write_dbdata_file(data_as_list, output_filename, mode=”w”, header_as_list=[], delimiter=”t”) def write_list_file(list_data, output_filename, mode=”w”)

USAGE:

from clioedb import mydb

db_credential = { “user”: “root”, “password”: “password”, “host”: “127.0.0.1”, “db”: “sql_store”, }

sql = “SELECT * FROM sql_store.customers;”

output_filename = “output.txt”

mydb.fetch_dbdata_file(sql, db_credential, output_filename, “w”, “t”)

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

clioedb-1.2.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

clioedb-1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file clioedb-1.2.tar.gz.

File metadata

  • Download URL: clioedb-1.2.tar.gz
  • Upload date:
  • Size: 14.9 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.9.5

File hashes

Hashes for clioedb-1.2.tar.gz
Algorithm Hash digest
SHA256 f508cb89da08fc18f9d4ed6605e491af3f9e2027209bc87f918f5c6737687300
MD5 64feea8a39d4f31343b820a1568db747
BLAKE2b-256 9095f04ae0bb3aececd889a94434e076bbf86a9908e15c97bef9e46615c63e14

See more details on using hashes here.

File details

Details for the file clioedb-1.2-py3-none-any.whl.

File metadata

  • Download URL: clioedb-1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • 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.9.5

File hashes

Hashes for clioedb-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e9eb4488a41c50d91fd8da60873d19cd0c9ac58476d4ee28dc49ac69dd70bf6
MD5 84d9f1b0087a345dab946afecf459ad3
BLAKE2b-256 0e65a2c81e489cced0c98365c8a23d46bc1e0c6883d9fedae0bfde338ccf1a36

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