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
Release history Release notifications | RSS feed
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
Close
Hashes for info_check_toolkits-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d594c2cd1960cd17c710370302a25d02b1b82c8a5af1975a94d8af722f69660d |
|
MD5 | 708a9b7d1be37c0131ed438fbaa57aa8 |
|
BLAKE2b-256 | 397c7d16dc0d7b655806769b5b7e3b3b556b231c5f5aac6cbf623988378b4b43 |