Skip to main content

Chilean rut Python package - Chilean Rut/Run validator and formatter library

Project description

Chilean Rutify

Chilean Rutify is a Python library that provides utilities for Chilean RUT (Rol Único Tributario) validation and manipulation.

Installation

You can install Chilean Rutify via pip:

pip install chileanrutify

Usage

You can directly use the utility methods provided by the library:

from chileanrutify import normalize_rut, format_rut, valid_rut, valid_rut_verifier, valid_rut_values, get_verifier, dash_only_rut, classic_rut

# Example RUT: '36.408.368-8'
rut = '36408368-8'
chileanrutify.normalize_rut(rut)
# >>> "364083688"
chileanrutify.format_rut(rut)  # alias for chileanrutify.classic_rut(rut)
# >>> "36.408.368-8"
chileanrutify.format_rut(rut, 'dash_only')  # alias for chileanrutify.dash_only_rut(rut)
# >>> "36408368-8"
chileanrutify.format_rut(rut, 'normalized')  # alias for chileanrutify.normalize_rut(rut)
# >>> "364083688"
chileanrutify.valid_rut(rut)
# >>> True
chileanrutify.valid_rut_verifier(rut)
# >>> True
chileanrutify.valid_rut_values(rut)
# >>> True
rut = "36408368"
chileanrutify.get_verifier(rut)
# >>> "8"

Development

After cloning the repository, set up your environment and run tests:

pip install -r requirements.txt
pytest

To install the library locally:

pip install .

To test the library in interactive Python prompt user:

python

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mihailpozarski/chilean-rutify-py. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The library is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Chilean::Rutify project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

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

chileanrutify-0.2.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

chileanrutify-0.2.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page