Skip to main content

数据检验的工具

Project description

DataVerification

  • DataVerification是用于数据检验的工具
  • 包含对多种数据的多种验证:身份证、社会信用码、时间、数字、geo数据、邮箱、电话、邮编、网络地址等
  • 提供同步检验方法和异步检验方法,通过调用类来实现,异步方法在异步类中,异步类以Async结尾
  • 安装DataVerification
pip install data-verification

主入口:data_verification

  • 方法主入口,包含所有检验方法
import data_verification as dv

pdv = dv.PublicDataVerification()
pdva = dv.PublicDataVerificationAsync()
gdv = dv.GeoDataValidator("", "")
gdva = dv.GeoDataValidatorAsync("", "")
  • 所有基类方法可从相应文件导入,例如
from data_verification.public.id_number import IDNumber
from data_verification.public.id_number import IDNumberAsync

idn = IDNumber()
idna = IDNumberAsync()
  • 所有基类方法和PublicDataVerification, PublicDataVerificationAsync,GeoDataValidator, GeoDataValidatorAsync可从gather中全部获取
from data_verification.gather import IDNumber
from data_verification.gather import IDNumberAsync
from data_verification.gather import PublicDataVerification
from data_verification.gather import PublicDataVerificationAsync
from data_verification.gather import LineDataValidator
from data_verification.gather import GeoDataValidator
from data_verification.gather import GeoDataValidatorAsync

idn = IDNumber()
idna = IDNumberAsync()
pdv = PublicDataVerification()
pdva = PublicDataVerificationAsync()
ldv = LineDataValidator("")
gdv = GeoDataValidator("", "")
gdva = GeoDataValidatorAsync("", "")

PublicDataVerification, PublicDataVerificationAsync

from data_verification import PublicDataVerification
from data_verification import PublicDataVerificationAsync

pdv = PublicDataVerification()
pdva = PublicDataVerificationAsync()
  • 在data_verification中直接导入即可
  • DataVerification包含所有的同步方法(除geo相关)
  • DataVerificationAsync包含所有的异步方法(除geo相关)
  • PublicDataVerification拥有异步类PublicDataVerificationAsync,其基类全部都有相对应的异步基类
  • PublicDataVerification包含:
    • Regex:正则表达式相关基类
    • SCC:社会信用代码相关基类
    • Number:数字相关基类
    • Email:邮箱相关基类
    • IDNumber:身份证相关基类
    • Organization:组织机构相关基类
    • Compare:比较相关基类
    • VerifyType:类型相关基类
    • Coordinates:经纬度相关基类
    • Time:时间相关基类
    • IPAddress:网络地址相关基类
    • PhoneNumber:电话号码相关基类
    • AdminDivision:区划编号相关基类
    • Decode:字符编码相关基类
    • Postal:邮政编码相关基类
    • Empty:空值相关基类
    • Unique:唯一值相关基类
  • PublicDataVerificationAsync包含:
    • RegexAsync:正则表达式相关异步基类
    • SCCAsync:社会信用代码相关异步基类
    • NumberAsync:数字相关异步基类
    • EmailAsync:邮箱相关异步基类
    • IDNumberAsync:身份证相关异步基类
    • OrganizationAsync:组织机构相关异步基类
    • CompareAsync:比较相关异步基类
    • VerifyTypeAsync:类型相关异步基类
    • CoordinatesAsync:经纬度相关异步基类
    • TimeAsync:时间相关异步基类
    • IPAddressAsync:网络地址相关异步基类
    • PhoneNumberAsync:电话号码相关异步基类
    • AdminDivisionAsync:区划编号相关异步基类
    • DecodeAsync:字符编码相关异步基类
    • PostalAsync:邮政编码相关异步基类
    • EmptyAsync:空值相关异步基类
    • UniqueAsync:唯一值相关异步基类

GeoDataValidator, GeoDataValidatorAsync

from data_verification import GeoDataValidator
from data_verification import GeoDataValidatorAsync

gdv = GeoDataValidator("", "")
gdva = GeoDataValidatorAsync("", "")
  • 在data_verification中直接导入即可
  • DataVerification包含所有geo相关的同步方法
  • DataVerificationAsync包含所有geo相关的异步方法
  • GeoDataValidator拥有异步类GeoDataValidatorAsync,但是其基类没有相对应的异步基类
  • GeoDataValidator包含:
    • LineDataValidator-矢量线数据位置合理性验证
    • PolygonDataValidator-矢量面数据位置合理性验证
    • PointDataValidator-矢量点数据位置合理性验证
    • LineTopologyValidator-线拓扑规则合理性验证
    • PolygonTopologyValidator-面拓扑规则合理性验证
    • PointTopologyValidator-点拓扑规则合理性验证
  • GeoDataValidator以及GeoDataValidatorAsync初始化包含三个参数
    • file_path: 地理数据shp文件路径
    • validator_type: 验证器类型,如 'point_data'-矢量点数据位置合理性, 'line_data'-矢量线数据位置合理性, 'polygon_data'-矢量面数据位置合理性, 'point_topology'-点拓扑规则合理性, 'line_topology'-线拓扑规则合理性, 'polygon_topology'-面拓扑规则合理性
    • boundary_file_path: 边界多边形shp文件地址(可选)
  • GeoDataValidator包含两个方法
    • check_validity: 检查地理数据位置合理性和拓扑规则
    • check_specific_validity: 检查特定地理要素的位置合理性和拓扑规则

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

data_verification-0.0.2.2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

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

data_verification-0.0.2.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file data_verification-0.0.2.2.tar.gz.

File metadata

  • Download URL: data_verification-0.0.2.2.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for data_verification-0.0.2.2.tar.gz
Algorithm Hash digest
SHA256 54702d6347852ead5c7604508f2527c2516eaaeac6a16c80115b00564003cd05
MD5 79701bbf05e742ffb8212cef0256efab
BLAKE2b-256 0d726747f3be6c95bde3d07ab21c2b55af021d56e4173b2340848fec7c1ca9d8

See more details on using hashes here.

File details

Details for the file data_verification-0.0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for data_verification-0.0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b0001b3fb3d157ee3b5770b72438ce066942ca3d112cd2f5cfd3063f7012cb6
MD5 f50aa0e431eefcfff94db4f8b1ab96c4
BLAKE2b-256 367c4c5b18cd8c4f080b25ab6974426df023be9e117e71f726198245a115f419

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