Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql-field-report

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-field-report

  • 1.2.7
  • PyPI
  • Socket score

Maintainers
1

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:

ColumnDescription
Table/FileThe table or file of the analysed field
FieldThe analysed column/field
CountThe number of records in the table/file
PopulatedFor the column/field, how many rows are populated
UniqueFor the column/field, how many unique values are present
DatatypeEstimated 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,
)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc