The mock-jutsu library provides a robust solution for developers needing high-quality test data, specifically through its pl_pesel function. This utility generates a valid Polish National Identification Number, known as PESEL (Powszechny Elektroniczny System Ewidencji Ludności). In the context of modern software development, having access to realistic mock data is essential for testing systems that handle sensitive European identity formats without compromising real user privacy or falling foul of data protection regulations like GDPR. By automating the creation of these identifiers, teams can ensure their applications are prepared for regional requirements with minimal manual effort.
Each identifier produced by pl_pesel adheres strictly to the official Polish standard, consisting of 11 digits. The first six digits represent the individual's date of birth in a YYMMDD format, followed by a four-digit serial number that includes gender encoding, and a final control digit. A critical aspect of this function is its precise implementation of the MOD-10 weighted checksum algorithm. This ensures that every generated string passes validation logic in external systems, accurately reflecting how the Polish government calculates these identifiers, including the specific month offsets used to distinguish between birth dates in the 19th, 20th, and 21st centuries.
Integration with mock-jutsu is designed to be seamless across various technical environments. Developers can quickly invoke the function via the command-line interface using the command "mockjutsu generate pl_pesel", or integrate it directly into Python-based automation scripts with the call jutsu.generate('pl_pesel'). For those conducting load or performance tests, the library offers native support for Apache JMeter through the ${__mockjutsu(pl_pesel,)} syntax. This versatility makes it an indispensable tool for populating staging databases, testing complex API endpoints, or verifying front-end validation logic during the early stages of the development lifecycle.
Utilising pl_pesel for test data offers significant benefits, particularly when building Know Your Customer (KYC) workflows, banking modules, or financial applications targeted at the Polish market. By using synthetically generated but mathematically correct identifiers, engineering teams can simulate a wide range of edge cases—such as leap year birthdays or different century offsets—without the legal risks associated with handling genuine personal information. Ultimately, mock-jutsu empowers developers to build more resilient, secure, and compliant software by providing reliable, automated data generation tools that fit perfectly into any modern CI/CD pipeline.
mockjutsu generate pl_peselmockjutsu bulk pl_pesel --count 10mockjutsu export pl_pesel --count 10 --format jsonmockjutsu export pl_pesel --count 10 --format csvmockjutsu export pl_pesel --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pl_pesel --maskmockjutsu bulk pl_pesel --count 5 --maskfrom mockjutsu import jutsujutsu.generate('pl_pesel')jutsu.bulk('pl_pesel', count=10)jutsu.template(['pl_pesel'], count=5)# mask=True: regulation-compliant outputjutsu.generate('pl_pesel', mask=True)jutsu.bulk('pl_pesel', count=5, mask=True)${__mockjutsu_intl_ids(pl_pesel)}# JMeter Function: __mockjutsu_intl_ids# Parameter 1: pl_pesel# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_intl_ids(pl_pesel,mask)}GET /generate/pl_pesel# → {"type":"pl_pesel","result":"...","status":"ok"}GET /bulk/pl_pesel?count=10POST /template {"types":["pl_pesel"],"count":1}# mask=true: regulation-compliant outputGET /generate/pl_pesel?mask=trueGET /bulk/pl_pesel?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |