Generating realistic aviation industry data is critical for building robust travel applications and booking engines. The pnr_code function within the mock-jutsu library provides developers with a reliable way to create synthetic Passenger Name Record locators. These codes serve as the primary unique identifier within Global Distribution Systems (GDS) to retrieve flight itineraries, ticketing information, and passenger details. By using mock-jutsu, development teams can ensure their test data aligns with international aviation standards without requiring access to live production environments or sensitive customer databases.
The pnr_code generator follows the strict formatting rules utilized by major industry providers such as Sabre, Amadeus, and Travelport. Each generated string is exactly six characters long and consists of a combination of uppercase alphanumeric characters. To mirror real-world usability standards, the algorithm intentionally excludes ambiguous characters that could be easily confused, such as the letter O and the number zero, or the letter I and the number one. This high-fidelity approach to mock data ensures that the generated strings pass through validation logic and regular expression filters just as a legitimate booking reference would.
Developers and QA engineers can leverage the pnr_code function across a wide variety of testing scenarios. Whether you are validating the input fields of a mobile check-in interface, testing an automated flight status notification service, or performing load tests on a reservation database, having high-quality test data is paramount. The function allows for the rapid creation of thousands of unique records, making it an ideal choice for stress testing backend systems or populating staging environments during the early stages of the software development lifecycle.
Integration is seamless across multiple development environments, offering flexibility for different workflows. Users can generate a pnr_code directly from the terminal using the mock-jutsu CLI or integrate it into automated scripts with the Python command jutsu.generate('pnr_code'). Furthermore, the library provides built-in support for JMeter, allowing performance testers to inject dynamic data into their test plans via a simple function call. This versatility ensures that mock-jutsu fits into any modern CI/CD pipeline, significantly reducing the manual effort required to manage complex aviation datasets and accelerating the delivery of high-quality software.
mockjutsu generate pnr_codemockjutsu bulk pnr_code --count 10mockjutsu export pnr_code --count 10 --format jsonmockjutsu export pnr_code --count 10 --format csvmockjutsu export pnr_code --count 10 --format sql# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pnr_code --maskmockjutsu bulk pnr_code --count 5 --maskfrom mockjutsu import jutsujutsu.generate('pnr_code')jutsu.bulk('pnr_code', count=10)jutsu.template(['pnr_code'], count=5)# mask=True: regulation-compliant outputjutsu.generate('pnr_code', mask=True)jutsu.bulk('pnr_code', count=5, mask=True)${__mockjutsu_aviation(pnr_code)}# JMeter Function: __mockjutsu_aviation# Parameter 1: pnr_code# Parameter 2: (not required for this function)# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_aviation(pnr_code,mask)}GET /generate/pnr_code# → {"type":"pnr_code","result":"...","status":"ok"}GET /bulk/pnr_code?count=10POST /template {"types":["pnr_code"],"count":1}# mask=true: regulation-compliant outputGET /generate/pnr_code?mask=trueGET /bulk/pnr_code?count=5&mask=true| Parameter | Values | Description |
|---|---|---|
| --mask | true | false | Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…) |