Skip to main content

rut-chile

Python module that provides common functionality regarding Chilean RUT

Build Status

Installation

pip install rut_chile

or

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

python setup.py install

Usage

Validate RUT

from rut_chile 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

from rut_chile import rut_chile

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

Format RUT

from rut_chile import rut_chile

rut_chile.format_rut_with_dots("12667869k")
# returns "12.667.869-k"
rut_chile.format_rut_without_dots("12667869k")
# returns "12667869-k"
rut_chile.format_capitalized_rut_without_dots("12667869k")
# returns "12667869-K"
rut_chile.format_capitalized_rut_with_dots("12667869k")
# returns "12.667.869-K"

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-2.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

rut_chile-2.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file rut_chile-2.0.1.tar.gz.

File metadata

  • Download URL: rut_chile-2.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.2

File hashes

Hashes for rut_chile-2.0.1.tar.gz
Algorithm Hash digest
SHA256 2e4210dc18c3fe85121d6840bdcf87519d1234241f58770e84b34e33a9b2cd3b
MD5 f2bed6039ff1a666b85290cd071ddfa8
BLAKE2b-256 a27194ea4e208dcdba5f0c5b0c02b4af48801c75ba241cf8aea27c22d9c74f2c

See more details on using hashes here.

File details

Details for the file rut_chile-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: rut_chile-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.2

File hashes

Hashes for rut_chile-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c39ced8e4e6c6c356008e5d88e7920b1c0b185267d7a657e3b53d2163a926ac9
MD5 712e380f1ab7bdd4799beac94268b8bf
BLAKE2b-256 be3cad741ad8428e8e0df6f367e3c27c2ccea5e1689a050d7d68a05dd062ccf9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 files

2.0.0

3 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page