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.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: clioedb-1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2e9bb044c70501018a76da4c326073200f84126d6f0fb488b95de7d0d05a3186
MD5 fe0b9e71fe2dbb072342418768f92165
BLAKE2b-256 79bf132b2970ee31386c91b9d3e749dac61221152342ca455a6718856a25133c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clioedb-1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbafb5d2e434f161d1235e1feee6cf16dd9d01ed515de95043843c91e2b799c4
MD5 6869fd34bf0f94f68c46b8ec031e8929
BLAKE2b-256 d6661e9ec5dc37a945a36570d20e80d7a7a0b379d3b3ae19ea6db1923e08d9b0

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