Skip to main content

数据检验的工具

Project description

DataVerification

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

主入口:data_verification

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

pdv = dv.PublicDataVerification()
pdva = dv.PublicDataVerificationAsync()
gdv = dv.GeoDataValidator("", "")
gdva = dv.GeoDataValidatorAsync("", "")
  • 所有基类方法可从相应文件导入,例如
from data_verification.id_number import IDNumber
from data_verification.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.1.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.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: data_verification-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 90976fc054f15d35c1c23f8f2358ec3bb18b16946669ea25a8a411cb1db2f3a7
MD5 73e62cd38114de844e452c30f3faa83f
BLAKE2b-256 948024e120533c819a78a6b020af4a735946a1109f52ef715380fe1a8c923e2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for data_verification-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b7f0097826a41a2b2ae6e115fb5a7ad2e0c80c3fd3c7dc5b027cb65ee376f0
MD5 230c15e4b7fc1d12cf541b385a8361ea
BLAKE2b-256 789dfdc51d84fb68b30bcd237954f00a54ffd58eddb3932daab7836b9d62e428

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