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

Uploaded CPython 3.14Windows ARM64

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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

cl_forge-0.4.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.4.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.4.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.4.0.tar.gz.

File metadata

  • Download URL: cl_forge-0.4.0.tar.gz
  • Upload date:
  • Size: 39.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.4.0.tar.gz
Algorithm Hash digest
SHA256 5b61913b82f815983af26b108334a834c3f1266775f91c41e090b4f7f71252da
MD5 8bc983001cc27142c751fbdcd847bde3
BLAKE2b-256 7fed35802898a325fb82dad5f8d0d86c9f9924e9ae12bda83ca1d8d1572cbb85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp314-cp314-win_arm64.whl
Algorithm Hash digest
SHA256 a626511d1fa65c32cfb9a47cc1fbd623ff88e3a65a0be5301502466ab8863e6c
MD5 97a72804c561bcdbdbb6c84fbf12670b
BLAKE2b-256 50336c5b9709e10ae82348650699b71af2c30c72ca5f1176ab1350a8c898eab9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 589e8508fb3a07719d9139dea45ce4e39a271ed2d43a2bf84b682a940cd0a372
MD5 f9da270bb6daeadab633bf211127f0b7
BLAKE2b-256 c410d7cb972c95b6090bb3b93a4869820c2f4b09abff155df605ee89a408637c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f57d66bbfc17d6676ff89b79331ed3a3d94bc5bff4cd10cdf770fe9fce90430
MD5 be05d3eb12d6b27c74353af64f4aead8
BLAKE2b-256 4a9b65919d5b3398cc2632cf27ec148be986724112ad26e01a17d9f5cb185fb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e28e0dda5c42081f4f3f9839f90a5641f8ccb9f451890faa3061d4a032fa1f87
MD5 3e787c8c34ae10b5e39c69bdf2f7fd5b
BLAKE2b-256 4692329d7e577ac98b118893465bbfe16e66e96ce545c0d543eb25405e7718a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 1a196d8cdba8a36466da40e599e9688bcde7071298737acaf35f706f7740f921
MD5 8d39b89249ca3f2069a0ac3aefff10e0
BLAKE2b-256 0f39fef6961cfc1aff40706ccacab8c823e1c405a55c8a7e8a1f773e493250d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 63717babaeddb9bec705d1b02cb42ccd41cf50fdfa2b8108f07d800f183ff1e6
MD5 96542dcf4fed1781d87855980c94ce6c
BLAKE2b-256 8cae9263cc7b5d4d9fe459d622b33289648b723b364bd12c107b46a945fab8fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1c5aedd6487b3e15592649d079bc854b8c68766d4efa75222b315848272ed77
MD5 787f37526f1dfda0652805d708d2c0fa
BLAKE2b-256 888b75992edd123141add5a3f30df89a28a766d93facf1c0437c9b2d6c7ac880

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ad306bbf80fdcf70a647aca13245fe3f0eaaa3dfd373a78b865cb214e17dac43
MD5 23254da560bc9829fb0b5de7b68ce50b
BLAKE2b-256 e021f8c108f21b960bd0eb0e244658b204f94d968ba4a796964b5aea07e67737

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 17c6f0193168bed8b331378df3c14ec6e3877f07b8569e1ee0c6d9e973e2b0aa
MD5 93c629898c7ecc96978e3407de5abae6
BLAKE2b-256 60a72ed971067e54ca6cd6375a555f0a66813b2d7fcb79fc0bad8ac9fc17ba93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd5db4f2251c4f6ae10204f4d94a177d7bd24593e8d2598415a613af8ead18fe
MD5 058ad9d5e46efbe0b0cbf9c4b17bc1a1
BLAKE2b-256 91f8628b87a1aecf8bc065b0e925adb79be8c665a647a9add81c94c41e5039b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e16f27dd714f80116e6cfa7b0156f6a67d44df9b357891757c2235ab792a56a
MD5 4c714a32403bd94eda5ea32be7f9d9d1
BLAKE2b-256 f077c663e35ceec6d8b667a898856777441905d83b52140cc55369d39ca3c7c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fe1c25cff3135d6d7b331a0db2ae1f7b1be75fe9c2d925f92963565e3145497f
MD5 c2005026c791d3cf2ec562eb7638e926
BLAKE2b-256 8a5f6e5ab68f64375b0786575f2b43552b6ef1a3626d256d7c17df30a2994ba0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe80c1414809e22efd6e890cb8b814c5759f00e5a62d914af9782c686b15f5f9
MD5 8699fdb61624dd0617ff91cfe42c8b13
BLAKE2b-256 c24e3d026b0ef29aa081e31a3afa5675e155672007b988b92cb7fe767456324b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cl_forge-0.4.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.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed3395fcb476d74da5a649892a3991f54e8fe7a0b4d6ed919c29a91c1c1356fa
MD5 bbb58ce9008d7728672e1a29f1404193
BLAKE2b-256 3fee01408aa70dc0fcc802556724b0efa458d0a470e71e94598232304a041b87

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