Skip to main content

No project description provided

Project description

SQL Field Report

Author: Will James

Downloads Pipeline

About

SQL Field Report is a polars powered data analysis tool, which summarises the schema of a given dataset. This can be a series of flat files (excel/csv) or tables in a database. It returns a table of analysis with the following columns:

Column Description
Table/File The table or file of the analysed field
Field The analysed column/field
Count The number of records in the table/file
Populated For the column/field, how many rows are populated
Unique For the column/field, how many unique values are present
Datatype Estimated CRM datatype for the column/field

Installation

To install use pip: pip install sql-field-report

To use as a CLI, call "sql-field-report" within a virtual environment:

python -m venv venv
pip install sql-field-report
venv/scripts/activate
sql-field-report --help

Usage

SQL Field Report is a Typer CLI tool to see the available functions run:

sql-field-report --help

 Usage: sql-field-report [OPTIONS] COMMAND [ARGS]...

Commands
 mssql-database-report                                      MSSQL Database Report                   
 mysql-database-report                                      MySQL Database Report

MSSQL Database Report

Generate an excel report summarising the data in an MSSQL Database

Args:
│ *    server                TEXT     [default: None] [required]                                                       │
│ *    port                  INTEGER  [default: None] [required]                                                       │
│ *    user                  TEXT     [default: None] [required]                                                       │
│ *    password              TEXT     [default: None] [required]                                                       │
│ *    database_name         TEXT     [default: None] [required]                                                       │
│ *    schema                TEXT     [default: None] [required]                                                       │
│ *    output_file_name      TEXT     [default: None] [required]

SQL Field Report can also be used as an importable package in python code:

from sql_field_report import build_dataframe_field_report, read_file

analysis_files = ["file1.xlsx", "file2.xlsx"]

build_dataframe_field_report(
    "Field_Report.xlsx",
    analysis_files,
    read_file,
)
import uuid
from os import getenv, listdir, remove
from os.path import join

from dotenv import load_dotenv

from sql_field_report.sql_field_report import MSSQL_Database_Report

load_dotenv()

file = f"Test_Report{str(uuid.uuid4())}.xlsx"
MSSQL_Database_Report(
    getenv("SERVER"),
    getenv("PORT"),
    getenv("USER"),
    getenv("SQL_SERVER_PASSWORD"),
    getenv("DATABASE"),
    "dbo",
    file,
)

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

sql_field_report-1.2.7.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sql_field_report-1.2.7-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file sql_field_report-1.2.7.tar.gz.

File metadata

  • Download URL: sql_field_report-1.2.7.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for sql_field_report-1.2.7.tar.gz
Algorithm Hash digest
SHA256 330568b1ab3756c03eecdbed910c0dda58d6dbdade20a4d824ae4fdc20b7d5a0
MD5 fecb3d967d666184e615f97867f72bb7
BLAKE2b-256 88a15093fde8c4a84a45358c42e05390ad97b12cfbdc241fd1698e73c45e8b3f

See more details on using hashes here.

File details

Details for the file sql_field_report-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: sql_field_report-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.12.3 Linux/6.5.0-1021-azure

File hashes

Hashes for sql_field_report-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a71f8d7a6e9f69b5a91831477941bdf78bbf554256a7cf394870070bf0e09f87
MD5 2ddced67452995f5ad369fc2f44ee655
BLAKE2b-256 0a022b62f9df1aef9c041533701a2e435a9a5be5018a9ba126630d6c4d0062dc

See more details on using hashes here.

Supported by

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