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.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-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: data_verification-0.0.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.tar.gz
Algorithm Hash digest
SHA256 fd50b7d42abf80d187576999d63563e4d7616c3b4ab786fe771feee4b530bdd1
MD5 85b8e075b2be9e5765196c91f9571268
BLAKE2b-256 0d8f88b0dfc2ec111e8dafa7a7ceea86d772e4f28b9e78e9806c67b036c2bdf0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for data_verification-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 928320c71d2c8760eff79ed7d07d6b614fb23ee41c917f1f1a15f1b353b8c704
MD5 404bbce30ec1f99d9e9f00ce58384188
BLAKE2b-256 3d7caba9ad8f7aef38d41b822580353f1792806c53fc12aa5867c5281d831589

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