Skip to main content

Simple yet powerful Chilean and other tools written in Rust and Python.

Project description

Python package

cl-forge 🇨🇱

Simple yet powerful Chilean and other tools written in Rust and Python.

cl-forge provides a collection of high-performance utilities for common Chilean data formats and API integrations. The core logic is implemented in Rust for maximum speed, with a clean and easy-to-use Python interface.

Features

  • Verify: Efficiently validate and manipulate Chilean RUT/RUN and PPU (License Plates).
  • CMF API: A simple client to interact with the Chilean Financial Market Commission (CMF) API.
  • High Performance: Core logic written in Rust.
  • Lazy Loading: Submodules are loaded only when needed to keep the initial import fast.
  • Type Safety: Full type hints and .pyi stubs for excellent IDE support.

Installation

pip install cl-forge

Or using uv:

uv add cl-forge

Usage

Verification (RUT & PPU)

from cl_forge import verify

# Validate a RUT
is_valid = verify.validate_rut("12345678", "5")
print(f"RUT is valid: {is_valid}")

# Calculate RUT verifier
dv = verify.calculate_verifier("12345678")
print(f"Verifier digit: {dv}")

# Work with PPUs (License Plates)
ppu = verify.Ppu("PHZF55")
print(f"Normalized: {ppu.normalized}")  # PHZF55
print(f"Verifier: {ppu.verifier}")      # K
print(f"Complete: {ppu.complete}")      # PHZF55-K

CMF API Client

To use the CMF API, you need an API key. You can request one at CMF Chile.

from cl_forge.cmf import CmfClient

client = CmfClient(api_key="your_api_key_here")

# Get IPC data
ipc_data = client.get(path="/ipc")
print(ipc_data) # {'IPCs': [{'Valor': '-0,2', 'Fecha': '2025-12-01'}]}

See the CMF API documentation for details about the available endpoints.

Development

This project uses maturin to build the Rust extension.

Setup

  1. Clone the repository:

    git clone https://github.com/mschiaff/cl-forge.git
    cd cl-forge
    
  2. Install development dependencies (using uv):

    uv sync --all-groups
    
  3. Build the Rust extension in develop mode:

    uv run maturin develop
    

Running Tests

uv run pytest

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

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

cl_forge-0.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distributions

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

cl_forge-0.1.0-cp314-cp314-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.14Windows x86-64

cl_forge-0.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

cl_forge-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cl_forge-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

cl_forge-0.1.0-cp313-cp313-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.13Windows x86-64

cl_forge-0.1.0-cp313-cp313-win32.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86

cl_forge-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

cl_forge-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cl_forge-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

File details

Details for the file cl_forge-0.1.0.tar.gz.

File metadata

  • Download URL: cl_forge-0.1.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for cl_forge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6671aa7b9eabeaa6d7614a2484eece041f535e76fd852a96fc0c07a624210d32
MD5 7da0d56aa263fa123bf68e2e35aad845
BLAKE2b-256 5770b6668f2c955b6ac23aba9e3ec23e54690fd0b97288b3348a70586dd8c96a

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: cl_forge-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cl_forge-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 3dddde58d641dfba9208346ef2270c6080a697606c41fda257d07327a42291f9
MD5 08f4c7780de6b1100102403946e315db
BLAKE2b-256 685425096027146e9564d94157d18e4ab9b2806237e8d79c0a70cf92e36f2031

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 982a34b95423c0136f6b4fee2105b99ecd4d6243bb307da4991385678165a484
MD5 963efcbac374ceaa699bb2b617f15d15
BLAKE2b-256 bc4b0d2a29a573327ce1cb86f35acdf6184eaa7a50d6bd4492b22591214a7f83

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06ad7baf31585b6171393c38fdbdbb1dc1639ef64fc1e73d52cfaf23e6e0b19f
MD5 4ba98204d60349e7792c2262cbdf95b5
BLAKE2b-256 2bae8d8dd983e081d74656ecc06dd11dd40c5cb9e2a6082b1a6586f8692951a1

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a98e46005fb362702359e6a6726ef47f9937592ec894f5eeb765c470fc436e2c
MD5 9e139583d545712c9699585a673ebd35
BLAKE2b-256 97b5049817b9dd8e69f594aae59ebdebde0b069406ad53869b68aaae93b44d3e

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cl_forge-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cl_forge-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a8e8b14acfef4f2c8f5bfed597c43a1c64c4c510cc866dd15a61fa5bfbaf1bc5
MD5 f8b864e69f23afab52dc46412ba6fc23
BLAKE2b-256 395f4aa8b0343ec977f1b37c615f92d652c18713768fab90bb6ee8c2591ceb6a

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: cl_forge-0.1.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cl_forge-0.1.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 99b1f319d2217ad8023c1da49df0f3beddb74f04e9c2d53e73ba0146561809e1
MD5 696f23c82e170d62f96b640eb5a51a86
BLAKE2b-256 1c88a68156f1859089c6f71d279480b2a1d10965af9ca8469bdb58eb5d4ebb43

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dd677310334e1af7d6c79e53616f617234a0b4fd931e056de9b0e5a92cf0a97
MD5 00d8817f577d18ed55013d86b4ab7055
BLAKE2b-256 96fcefd6c8b101f15584da61a293b81396c98ce0b084e8b0136810f414bf3eb5

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6b7bf5b1264a3bda7c47e7f83c4db9578a6669b3a7d5bb5d1010e769f6d13d0
MD5 9f4a0a17127af17bac089a9aeaf6e1d8
BLAKE2b-256 dc7abb39daf7cfef3f5d534b69c459c73c8c2071e156bbd6895df0ef09ebe8e9

See more details on using hashes here.

File details

Details for the file cl_forge-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cl_forge-0.1.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a6d2cd720f3676b51808ba3284bc135c7f5372660d55d283a513ce1ca745e9d4
MD5 db15669b03dfafac36871886ba617cfb
BLAKE2b-256 3305d913ccda65a8199abf5290e0e2550695dda003b929d388a0df6b00db6d4a

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