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

Uploaded CPython 3.14Windows ARM64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

cl_forge-0.5.1-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.1-cp312-cp312-win_arm64.whl (2.6 MB view details)

Uploaded CPython 3.12Windows ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

cl_forge-0.5.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: cl_forge-0.5.1.tar.gz
  • Upload date:
  • Size: 43.6 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.1.tar.gz
Algorithm Hash digest
SHA256 de583f9efb02aba4b003eea8913cc3638b5dbe2074f8d91ec89c978fa99e5f4b
MD5 5f698630a5f2db045f05fea8c8a590b9
BLAKE2b-256 b431c656f5d98e9b505158599e218faa49c074f5150e2efff53f94375bc7f972

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp314-cp314-win_arm64.whl
Algorithm Hash digest
SHA256 0b3c560c5c146702f2628dfa77b3448b51aca0c23d109f11fe5d0389fa6cafb2
MD5 4a5c4a7dc1f262b74ac815b341cc8293
BLAKE2b-256 0852932e36657221ae03d30e4314d4b96d6279cf9418787d94ea4372eb6ae3b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1395153a5844d53db7e538ea7aae760860f1a77b1bff419d0ede722919731162
MD5 b3f85984c06f626ca0b412e19754000f
BLAKE2b-256 93163e8f66ffd12134be78466e722660e56f19eae0b9ca0dec5e87655f68e86b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac7e03ad5d79d5556d08843f1a93a2715bad1d90578fb68bd4fbd9ff3e0b92d8
MD5 fca9fa1efcc47eca5a6c51ba1a20dddf
BLAKE2b-256 96204b9e9ef72e25945b9aa7643e1958c23c892a1434e861330184adbe645b98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f97bbdfc04f2241c919fee4264e664b8e50e40f5c8ca34a23a9b164506ef8b74
MD5 c47842219373200b1eacc0c5e8f770bb
BLAKE2b-256 9baa5880d39b194c6e6902310504ddac7beac7d0e5ffdf5e3cc27d4120d15d2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 95674a4e2744214ec0e5b50d51097314881fa4c262afed792f1eb83809ca4f1e
MD5 1d4fb955c3f6dbc0fb6453b6d2985e66
BLAKE2b-256 74c3dcb15f17eb99bc4c011c4ef3bf8ed70ab4f2c39b3f24e0f10200d5caad36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b739ff64836938b204e38dc00adcb192ec9718ab0969c493ea9092de43990d26
MD5 b5def9149cc3f31a20300a5d4c64f7ab
BLAKE2b-256 2239f59b1cc2491c626230af49a45a701060be653bb7a4036ba45f32b93b3e26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38626f45c413b9e5abc5dbc566d61ff2465cb321b3f0242859ea2ee4e43d838e
MD5 053959f75800019b4b30a85e545fe503
BLAKE2b-256 8fcca3ae566075ab2e1d13262adc4e4c831da2ddbbbcc91f78d22035deee7290

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cca78195d26c7e8a2ced64cbd8d11555c1187bf96ceb5ba91bec32ca7d1c1cd7
MD5 bf10456e1f46305ebcc0f4952def5487
BLAKE2b-256 085fd1bbe73a01f282f7fab78a7276ccb219eddecc593faeeb492a6db4a231ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 f487d15c57564bc12abcd7db6c09e0209ddb9e8058ead49996b3d0d9aca890ec
MD5 66846c4999fae85989f5c5a4f3abc4d2
BLAKE2b-256 22c359f27ddceedb37a165f07c38c3a302ed2ce1ef5ef1684c5f699b037af916

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e3b9cc0d8b166557f872b8f5b455d1b9fb5253d7783b732e794e49e799685b94
MD5 8809c7045b854a0533cd6b2c8343d5b5
BLAKE2b-256 51b75af80a66075a72429ea5dc0587663d4cfbee83bceed0732293bfbe226ab3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc8ff29d8f89f2d221b7641b5b8a835499acbd1e4799203d977f6a50d28e2f6e
MD5 b7cebddcbeb6a9e878e0ea67af1c9a55
BLAKE2b-256 c19677ab4e77256298f7049995baba02c59206f991882a13ae55ddd2551cbdf2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 faf66fdb89111c3550a164a58dfac3f791e14f61c3a5b688ea4c6fa2ee0d4d11
MD5 c8632886fcfcdeece4787d859d7fe087
BLAKE2b-256 8155c40a1349d036f7f1e6941ac7a8932df8105955791428c6d52b384a013e9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e407e59091e9a851d53e301818ca256eaf32746833c98601c6aa416b5427ba5
MD5 82813273cfc4765d5b5283fe056e023d
BLAKE2b-256 ce03d13402454a66e887c799d7840f4e09915cdaec08f344dd3074a2bc5e9ad6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.5.1-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.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb08ccff85be5598b5e79d04d35ba8762a1cf156c7c965d1034e17a0d49bfa90
MD5 70de5c786ddc7a440d986463036d7267
BLAKE2b-256 9aec8be0649c692e164d3295445f9980bf989035e5acf51771c579ff39b064c7

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