智利RUT验证包

rut-chile的Python项目详细描述


RUT智利

python模块,提供有关智利rut的通用功能

Build Status

安装

pip install rut_chile

git clone https://github.com/gevalenz/rut-chile.git

python setup.py install

用法

确认车辙

import rut_chile

rut_chile.is_valid_rut("12345678-9")
# returns False
rut_chile.is_valid_rut("6265837-1")
# returns True


# It works with the following formats

rut_chile.is_valid_rut("98685030")
# returns True
rut_chile.is_valid_rut("9868503-0")
# returns True
rut_chile.is_valid_rut("9.868.503-0")
# returns True
rut_chile.is_valid_rut("12.667.869-K")
# returns True
rut_chile.is_valid_rut("12.667.869-k")
# returns True

获取验证数字

import rut_chile

rut_chile.get_verification_digit("9868503")
# returns "0"
rut_chile.get_verification_digit("12667869")
# returns "k"
rut_chile.get_verification_digit("12667869", True)
# returns "K"

格式RUT

import rut_chile

rut_chile.format_rut("98685030")
# returns "9.868.503-0"
rut_chile.format_rut("98685030", with_dots=False)
# returns "9868503-0"
rut_chile.format_rut("12667869k")
# returns "12.667.869-K"
rut_chile.format_rut("12667869k", upper=False)
# returns "12.667.869-k"

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用jaxb2annotateplugin和XJC工具的java自定义注释   java组织。xeustechnologies。jcl无法加载WstxInputFactory类   java JUnit在格式化字符串上比较失败   java Bukkit配置部分getKeys   如何关闭Java流?   java Struts2正则表达式配置   链式事务注释的java奇怪行为   java在两个JButton之间使用变量   java签署APK时内容会发生什么变化?   java LWJGL:Slick:3D世界中的绘图字体   如何分解Java数组?   在Java MySql中处理多个过滤器   java如何在Firebase数据库中跳过初始OnChildaded事件触发   java如何在PreviewView中使用CameraX?   在子类#中重写父类后访问父类原始方法的java已解决   java找不到类型的属性   游戏框架游戏!框架+Java