Skip to content
CAI
Software that uses CAICheck a score

fazedordecodigo/PyFlunt

65.4

Adequate · 9 November 2026

2.2k

lines of production code

Python

primary language

10

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Flunt is a Python library that provides a contract-based validation framework for building value objects with robust error handling. It centralizes validation logic, error messages, and regex patterns to ensure consistent data integrity across applications. The system includes a notification mechanism to collect and manage validation failures, supporting both standard and Brazilian-specific data formats. It is designed for modern Python environments with comprehensive type safety and testing infrastructure.

How it got here

2021 — Initial project setup and architecture

8 changes.

This period established the foundational structure of the Flunt library, introducing modern Python tooling, configuration, and package organization. It implemented core architectural changes, including a refactored notification system using dataclasses and protocols, and centralized regex patterns for validation logic. Initial test coverage and sample modules were also added to verify the new validation contracts and system behavior.

2023–2024 — test coverage and message centralization

5 changes.

This period focused on expanding test coverage by adding mock entities, value objects, and comprehensive validation suites for various data types and localization patterns. Additionally, validation error messages were centralized into a new constants module to improve maintainability and consistency across the library.

Features

New sample modules for validation and performance measurement

Added new sample files (\samples/\_\init\\_.py\, \samples/flunt\_sample.py\, \samples/main.py\) that demonstrate the library's validation contracts via a \Pessoa\ (Person) value object and provide utility functions for logging and timing code execution. The \flunt\_sample.py\ module specifically shows how to use the \Contract\ class for field validation and integrates with the \Notifiable\ interface, while \main.py\ offers a basic example of try-except performance measurement.

samples · high confidence

Behavioural changes

Centralized regex pattern definitions and retrieval utility

The localization module now includes a dedicated \flunt\_regex\_patterns.py\ file that centralizes common regular expression patterns (such as email, passport, CPF, and CNPJ) into a single dictionary. It also provides a \get\_pattern\ function to retrieve these patterns by name, allowing validation logic to access standardized regex definitions from one location rather than defining them inline.

flunt/localization · high confidence

Centralizes validation error messages in a new constants module

A new \flunt.constants\ package has been introduced to centralize all validation error messages. This change extracts string literals for field validation (such as required, length, email, credit card, and type checks) into \flunt/constants/messages.py\ and exposes them via \flunt/constants/\_\init\\_.py\. For users, this means validation error text is now managed in a single location, making it easier to maintain consistency or customize error messages across the library.

flunt/constants · high confidence

Refactor notification system to use dataclasses and protocol-based architecture

The notification system has been refactored to improve type safety and code structure. The \Notification\ class is now implemented as a dataclass, simplifying its definition and string representation. The \Notifiable\ class now inherits from a new \NotifiableProtocol\ abstract base class, enforcing a consistent interface for managing notifications (adding, retrieving, and clearing) across the library. This change standardizes how objects handle validation feedback and improves static type checking support.

flunt/notifications · high confidence

Validation contracts now use standard library regex patterns instead of hardcoded logic

The validation contracts for email, URL, and credit card numbers now delegate pattern matching to the centralized \flunt.localization.flunt\_regex\_patterns\ module. This change replaces previous inline or hardcoded validation logic with standardized, cached regex patterns, ensuring consistent validation behavior across the library and simplifying future pattern updates.

flunt/validations · high confidence

Test coverage

Added mock entity for testing; Added mock value object tests for Name and Email validation; Added tests for localization regex patterns; Added unit tests for the Notification class; Comprehensive test coverage for validation contracts; Initial test coverage for Name validation logic.

Dependencies

Initial project configuration with modern Python tooling

The project introduces a formal build configuration via pyproject.toml, establishing Flunt version 3.1.0 with a minimum Python requirement of 3.11. This setup integrates a comprehensive development environment including ruff for linting and formatting, mypy for type checking, and pytest with coverage for testing. It also adds pre-commit hooks and documentation tooling (mkdocs), while defining the package metadata, license, and repository URLs.

(dependencies) · high confidence

Housekeeping

Empty package initialization file created

An empty \_\init\\_.py file was added to the flunt package directory, establishing it as a valid Python package namespace.

flunt · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 65 → 65 (+0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 56 → 57 (+0.5)
  • Readiness 61 → 61 (+0.0)
  • Security 72 → 72 (-0.1)

Resolved (5)

  • Duplicate Utility Function: The function 'time_me' is exposed in both 'samples.flunt_sample' and 'samples.main'. This suggests copy-pasted utility code rather than a shared utility module.
  • High CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Naming Inconsistency: The Collections contract uses 'is_lower_than' while the Numeric contract uses 'is_lower_than_number'. Similarly for 'greater', 'between', etc. The suffix '_number' is inconsistent with the general pattern used in Collections.
  • Redundant Protocol Definition: The NotifiableProtocol is an exact duplicate of the Notifiable class interface. In Python, this is unnecessary unless structural typing is strictly enforced via ABCs with abstract methods, but the signatures are identical, suggesting the protocol adds no value and creates maintenance overhead.

New (3)

  • High CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Orphaned file (flunt/validations/datetime_validation_contract.py)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

fazedordecodigo/PyFlunt was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 226d751031a899ee312efe4c950ac9796f4b5109 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.4+preprod-464a0040a931.