pt_ccIntlIDs

Mock Jutsu HOW-TO | EN

The pt_cc function is a specialized utility within the mock-jutsu library designed to generate realistic Portuguese Citizen Card numbers for software testing. As developers build applications for the European market, particularly those targeting Portugal, the need for valid-looking identification numbers becomes critical. This function produces a string that follows the official Cartão de Cidadão format, which typically consists of an eight-digit base number, a single check digit, and a three-character versioning suffix composed of two letters and one final digit. By using this utility, engineers can ensure their systems handle Portuguese national IDs without relying on sensitive, real-world information.

When generating test data with the pt_cc function, the library adheres to the specific alphanumeric structure required by Portuguese authorities. The generated strings, such as "12345678 0 AB4", are crafted to pass common front-end validation masks and back-end regex checks. This is particularly useful for verifying the integrity of database schemas and ensuring that input fields correctly accommodate the spacing and character types unique to these IDs. Because mock-jutsu integrates seamlessly into various environments, developers can invoke this function via the Python API using jutsu.generate('pt_cc'), or through the CLI using mockjutsu generate pt_cc for quick data seeding during the development phase.

Beyond simple form validation, this mock data generator is essential for complex testing scenarios like Know Your Customer (KYC) workflows, financial platform integration, and government portal simulations. Utilizing the pt_cc function allows QA teams to perform high-volume load testing using the JMeter plugin syntax ${__mockjutsu(pt_cc,)} without compromising data privacy. Since the generated values are syntactically correct but not tied to actual individuals, it helps organizations maintain GDPR compliance while providing developers with the robust data sets needed to identify edge cases in their processing logic.

The primary benefit of using mock-jutsu for generating Portuguese IDs is the significant reduction in manual data entry and the elimination of privacy risks. Instead of manually inventing numbers that might fail checksum algorithms, developers can automate the creation of thousands of unique records in seconds. This streamlines the development lifecycle, improves test coverage, and ensures that the application is ready for the Portuguese market. Whether you are building a small local application or a large-scale international enterprise system, the pt_cc function provides the reliability and precision required for modern software quality assurance.

CLI Usage
mockjutsu generate pt_ccmockjutsu bulk pt_cc --count 10mockjutsu export pt_cc --count 10 --format jsonmockjutsu export pt_cc --count 10 --format csvmockjutsu export pt_cc --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pt_cc --maskmockjutsu bulk pt_cc --count 5 --mask
Python API
from mockjutsu import jutsujutsu.generate('pt_cc')jutsu.bulk('pt_cc', count=10)jutsu.template(['pt_cc'], count=5)# mask=True: regulation-compliant outputjutsu.generate('pt_cc', mask=True)jutsu.bulk('pt_cc', count=5, mask=True)
JMeter
${__mockjutsu_intl_ids(pt_cc)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: pt_cc# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(pt_cc,mask)}
REST API
GET /generate/pt_cc# → {"type":"pt_cc","result":"...","status":"ok"}GET /bulk/pt_cc?count=10POST /template {"types":["pt_cc"],"count":1}# mask=true: regulation-compliant outputGET /generate/pt_cc?mask=trueGET /bulk/pt_cc?count=5&mask=true

Parameters

Parameter Values Description
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages