Package for validating Chilean RUT
Project description
rut-chile
Python module that provides common functionality regarding Chilean RUT
Installation
pip install rut_chile
or
git clone https://github.com/gevalenz/rut-chile.git
python setup.py install
Usage
Validate RUT
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
Get verification digit
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"
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
rut_chile-1.1.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for rut_chile-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7af8fea1b70f90f36bb835bc9a9e4854c831516b00d750254f0cdd175dd38766 |
|
MD5 | 10006f2a62ff8c03db185b01edaf81b8 |
|
BLAKE2b-256 | 1e9ce702f70b14a84f5f45c7e3a2ae39b8c70cf932683f2f7849b0ddf0e388c4 |