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

csvprofiler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvprofiler

An extensible CSV column profiling and validation utility

  • 1.2.0.post1
  • PyPI
  • Socket score

Maintainers
1

CSV Profiler

An extensible CSV column profiling and validation utility written in Python 3.

Purpose

This open-source project was developed to provide a feature-rich column validation and profiling utility for CSV files without the need for writing any code. It was also designed to allow quite a bit of extensibility for those understanding Python and regular expressions, and with the expectation that the main testing module be used in the future to validate other file types. It should serve as a helpful tool for those working with extremely large CSV files or who work with relatively large CSV files with the same format on a routine basis where validation would be useful.

Python Scripts

  • csvpcg.py - the CSV modeling and configuration generator script

  • csvprofiler.py - the CSV profiling and validation utility

  • profmod.py - the field testing engine used by csvpcg.py and csvprofiler.py

  • wrapdemo.py - a script demonstrating wrapper and imported script approaches to adding user functions

Features

  1. Automatic generation of configuration and parameter template files with column test recommendations.

  2. Profile any column, producing a report of unique column values and occurrence counts.

    • New: "unique" profile option reports duplicate values and the record sequence numbers where they were found.

    • New: "statistical" profile option uses a pandas series to generate a statistical column profile (i.e. mean, median, etc.)

  3. Column test options:

    • Over 70 built-in tests including custom developed regular expressions and hard coded tests utilizing Python functions.

    • User defined regular expression tests.

    • User defined lookup test lists.

    • User defined range tests using integers, floating point numbers and dates.

    • User defined column cross-reference tests allowing extensive testing of interrelated columns.

  4. Column length validation.

  5. Maximum column length validation.

  6. Output error CSV and log file options.

  7. Extensive control over error output limits.

  8. Ability to use external files for regular expressions, lookup lists, and column cross-reference test lists.

  9. Simple integration of database and user function hooks without changes to modules:

    • Using a Python wrapper script and a couple lines of code.

    • Using a configuration file entry to import a user function script.

  10. Easily integrate the field testing engine into existing scripts.

  11. Detailed report of column testing statistics, record level statistics and detailed column cross-reference test statistics.

Parameter File Example

csvp_optionsIDPrefixNameGenderLink_IDDeptTerritoryT_State
Column TestdigitAbbrevNameAlpharegex_LIDlookup_Deptxcheck_Txcheck_T
Column Length106
Max Length1050101022
Profile (y/n/p/u/s)yyyyy
Blank is Error (y/n)yyy
Strip Surrounding Spaces (y/n)yyyyyy
Error Output Limit5050505050
Error Output Limit - Length Tests505050505050
Error Output Limit - Blank Test50
User Data(A\d{5}|B\d{5})Adminnothingnothing
FinanceE(PA|NY)
HRSEFL
TrainingMW(IL|WI)
SalesSTX
OpsNW(WA|WY)
WCA
Grange(1:99)

Documentation

Complete user documentation is available here.

Installation

Software is available above and can be downloaded into your local Python scripts directory or installed using pip from PyPI.org (sudo pip3 install csvprofiler or sudo pip3 install --user csvprofiler). If you are installing on linux, you may need to chmod the scripts to allow execution.

Requirements

Version 1.2.0 now requires pandas to be installed (used in the new statistical profiling option).

Revision History

Version 1.2.0, March 24, 2021

  1. New "unique" profile option
  2. New "statistical" profile option
  3. 9 new latitude/longitude built-in tests
  4. other minor changes; full change list and details included in documentation

Prior versions are available on PyPI.org.

Supplemental Scripts

The "AWS Lambda" folder contains scripts and documentation on how to implement this software as an AWS Lambda function, using S3 or EFS as an input/output resource.

Licensing

Copyright (c) 2021 Larry Kuhn (larrykuhn at outlook.com)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. A copy can be found with the project at: https://github.com/LarryKuhn/CSV-Profiler/blob/master/LICENSE

Keywords

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