Skip to main content

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

Project description

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

From PyPI

pip install cl-forge

Or using uv:

uv add cl-forge

From Source

Using uv (Recommended)

uv pip install git+https://github.com/mschiaff/cl-forge.git

Using pip

pip install git+https://github.com/mschiaff/cl-forge.git

Note: Building from source requires a Rust toolchain installed on your system.

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}")

# Generate random RUTs
ruts = verify.generate(n=3, min=1_000_000, max=2_000_000, seed=42)
print(ruts)
# [{'correlative': 1133512, 'verifier': '9'}, ...]

# 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.

Generic Client

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'}]}

IPC Specialist Client

The Ipc class provides a more convenient way to interact with IPC-related endpoints, returning parsed Pydantic objects.

from cl_forge.cmf import Ipc

ipc_client = Ipc(api_key="your_api_key_here")

# Get current IPC
current_ipc = ipc_client.current()
print(f"Date: {current_ipc.date}, Value: {current_ipc.value}")

# Get IPC for a specific year
year_ipc = ipc_client.year(2024)
for record in year_ipc:
    print(f"{record.date.strftime('%Y-%m')}: {record.value}")

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.5.0.tar.gz (43.4 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.5.0-cp314-cp314-win_arm64.whl (2.6 MB view details)

Uploaded CPython 3.14Windows ARM64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

cl_forge-0.5.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.5.0-cp313-cp313-win_arm64.whl (2.6 MB view details)

Uploaded CPython 3.13Windows ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

cl_forge-0.5.0-cp312-cp312-win_arm64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows ARM64

cl_forge-0.5.0-cp312-cp312-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.12Windows x86-64

cl_forge-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cl_forge-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

cl_forge-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

cl_forge-0.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

File details

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

File metadata

  • Download URL: cl_forge-0.5.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1b3a875f0aecef35a21184ba21cd9771743c604b0b658d2900d9416858de41c4
MD5 b62f3a459645c618bbe27604e2b0f054
BLAKE2b-256 e217cce2b8c5d3f83090a1b5df9010e662ac89e90bcb668fd4089150562709fd

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp314-cp314-win_arm64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp314-cp314-win_arm64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.14, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp314-cp314-win_arm64.whl
Algorithm Hash digest
SHA256 76962b04f445b5f6d3c0459e1b1da4975232b06d0eb681ace295d80b3c53bf65
MD5 f275a5c77d31c50f2652bfdc8416194e
BLAKE2b-256 11b124298e14c42cfc048453a9def1718203412bb7a60ad50fca3f286ba5a91b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.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: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ab841e959083fb6d4a6bdca1683837de90b12313d8fdcd7d284480a0a20f1c8c
MD5 9634c37850371c7da0908a30e4dbb502
BLAKE2b-256 96f45d0e29ea51409d145535d970dcaab061f937ed07fca4f70f3d8172b96cfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.0-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10e0a8528d26f5931289b2d8bf95d677fa15d05de71bddaeabbe711999f2c8bb
MD5 46f1350e580e21dfb1b378162d458a77
BLAKE2b-256 78c6af6fa01e653dc731a61d6ecc599e9cdb50a81893ff9e14389e8d42bb375a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.0-cp314-cp314-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.14, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2a2b3fa82700b9c8afe679db77f0462dba9ac6b60d666ac5c7a25ed849239792
MD5 163bf28e21b07a56f979d142b296548a
BLAKE2b-256 6c16658afb3ded56d897b79c5505c2c28f2be43f2b0259e90a8faea93292c7b7

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp313-cp313-win_arm64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp313-cp313-win_arm64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.13, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 39559e164a67d935447bf7790b99778b25f38ca0266a8d52bd8ec414fcabb3d5
MD5 f4017732f72c65c849c66f3d74320f02
BLAKE2b-256 8bd7cac4f1fe8cdf883642f9023e1908217a91e8445e28dde268c13d83749b1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.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: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 59a4e9b0209eac354cc983fcb15b73c14dc00ed003231eecbc6052fcf2bc69cb
MD5 db0acaf46769375c9153adb6aaeec2b9
BLAKE2b-256 f788a5e78f4a1ff29d164c9d390170d1608171e23443106ee3b1a05f19311b78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b2a1cdc9f1245095ed2e07ab361b865bd27e2a3b300c0d2f3c05bcc83aeff6e
MD5 8f299d3c337ca5c767ccd637a33d654b
BLAKE2b-256 cf92dbcd7084c81b1aec7f8a119ccb4d368b5dc7f8ea2425a47252e9b38432d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.13, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e22e3ae6ead940eee5ecb53b5202b90c3056dfa57a91b56fc529d72194c3dd32
MD5 69be5ea8ab692d381c8be82f791c4a3b
BLAKE2b-256 b19186f607a882b3d93aae03aa120fe7e18eefd08e166c927a59086101be2e03

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp312-cp312-win_arm64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp312-cp312-win_arm64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.12, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 21afdf24ba4af4422d9ce9587ee607aeef6ec8916bd81a35506f35134da7c469
MD5 9d086b056cc6278ed2683694eeacea59
BLAKE2b-256 e12ab4bf301f65c7214c9cf3ceb258290e03533da6cb51e72c7a778ef0b7aea2

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8c13b965473a52266b71de726b499cd79582547d43c31108ba4cd631d83e85b2
MD5 e0eede9f8f8288ed9cf52ca5f48d4129
BLAKE2b-256 66cdc1f2aa926239bc2d74f1ce3a5b4abbf3d2dd9c9494d5e5c7cecace2894ea

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35b5bd029c096607db43fedf7612b788e482ef9b65f3e7e9a14ca6359f4e1f70
MD5 a8cbb461265870fdde5b510b5a82753f
BLAKE2b-256 a72748a77b256f6c6b75b97e985e96d36f6433eb13f132336c43c26bcd83cf0d

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.12, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7d94b5a356529aea9e3921658a43ea02377d94e71bb6612b9e1f393155362662
MD5 11f608ddfa44d5412f729664fcbf67ff
BLAKE2b-256 ff07a765a3c3096cc2d24d716350995bf1f0715f153cafc51025fa1f52b88aa2

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 636988153ffbe32bfa75d1ddb53a92bc3269c1f890eb1a8e1ba89180cbbf0000
MD5 409ade826986f7fb7e65c630324e074e
BLAKE2b-256 e6465fe2fc7d53655d6218595650d6c6050251b40213fb9bd14442aa627a3dbd

See more details on using hashes here.

File details

Details for the file cl_forge-0.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

  • Download URL: cl_forge-0.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cl_forge-0.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7f0f16a642d150a71cf6f4d474d27d3f5fa3046f8e69f0a2df53621740d98e9b
MD5 b18512017d3ff4b3248f773d67a24ea3
BLAKE2b-256 b63089784ee6c82de30170dca2f26cc1f78107e9eea82aa24b79499911da5bdf

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