Skip to main content

a set of toolkits for checking a dictionary with String values

Project description

Info Check Toolkits

Check a dictionary with String values

Probelms

Contains the result of the check

  • problem_type: empty value or invalid value
  • column: which column do the problem occur
  • msg: detail about the problem

Limits

Currently support four limits

  • num_limit(int): a certain limit of the length of the value
  • no_space(bool): control whether space can be used in value
  • is_date(bool): control whether the value has a format of YYYYMMDD
  • value_range(List): a list of value in which value can be choosen

Default options

  • num_limit: 0 (no limit)
  • no_space: True (space can't be used)
  • is_date: False
  • value_range: [] (no limit)

Processor

Attributes

  • columns: a list of the columns of the dictionary
  • limits: a dictionary from columns to Limit objects, store options for each column

Method

  • check_row(row): check given dictionary with given limits, return a list of problems or None

Usage

import info_check_toolkits as ICT

columns = ['name', 'age', 'sex']
limits = [
	ICT.Limit(num_limits=13),
	ICT.Limit(value_range=[str(i) for i in range(100)]),
	ICT.Limit(num_limit=1, value_range=('M', 'F'))
]

processor = ICT.Processor(columns, limits)

result = ICT.processor.check_row(row)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

info_check_toolkits-0.0.5-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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