phone_localContactLocale Aware

Mock Jutsu HOW-TO | EN

The phone_local function is a specialized utility within the mock-jutsu library designed to produce high-quality mock data for the subscriber portion of a telephone number. Unlike full international strings that include country or area codes, this function isolates the local sequence, typically represented as a seven-digit string in North American contexts or varying lengths depending on regional telecommunication standards. By focusing strictly on the local segment, developers can build more granular test data sets that accurately reflect how backend databases store constituent parts of a contact record. Whether you are working via the command line or integrating directly into a Python script, this function ensures that your development environment remains populated with realistic, non-identifiable information.

To maintain high standards of realism, phone_local follows standard telecommunication digit distribution patterns. The underlying algorithm avoids generating impossible sequences, such as numbers starting with restricted digits that might trigger validation errors in legacy systems or specific carrier protocols. This makes it an essential tool for creating test data that must pass through complex input masks or regex validators within a user interface. By utilizing mock-jutsu, engineers can automate the generation of thousands of unique entries, ensuring that load tests and stress tests are conducted with data that mimics the entropy of real-world subscriber directories without compromising privacy or security.

Incorporating phone_local into your workflow provides significant benefits for both frontend and backend testing scenarios. For frontend developers, it is ideal for testing form field constraints and ensuring that UI components handle varying string lengths gracefully. On the backend, it simplifies the process of seeding staging databases or generating CSV files for bulk imports. The versatility of mock-jutsu allows this function to be called through multiple interfaces, including a dedicated JMeter plugin for performance benchmarking. This cross-platform compatibility ensures that your testing strategy remains consistent across the entire software development lifecycle, from initial unit tests to final integration stages.

Ultimately, the phone_local function empowers teams to move faster by removing the manual burden of data creation. By providing a reliable source of randomized local telephone parts, it helps identify edge cases in data processing logic that might otherwise go unnoticed. As part of the broader mock-jutsu ecosystem, this function serves as a building block for complex contact simulations, allowing developers to focus on building robust features rather than worrying about the quality of their underlying test data. Its seamless integration and adherence to standard formatting make it a staple for any professional developer's toolkit.

CLI Usage
mockjutsu generate phone_local --locale TRmockjutsu generate phone_local --locale DEmockjutsu bulk phone_local --count 10 --locale TRmockjutsu export phone_local --count 10 --format json --locale TRmockjutsu export phone_local --count 10 --format csv --locale TRmockjutsu export phone_local --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate phone_local --locale TR --maskmockjutsu bulk phone_local --count 5 --locale TR --mask
Python API
from mockjutsu import jutsujutsu.generate('phone_local', locale='TR')jutsu.bulk('phone_local', count=10, locale='TR')jutsu.template(['phone_local'], count=5, locale='TR')# mask=True: regulation-compliant outputjutsu.generate('phone_local', locale='TR', mask=True)jutsu.bulk('phone_local', count=5, locale='TR', mask=True)
JMeter
${__mockjutsu_comm(phone_local,TR)}# JMeter Function: __mockjutsu_comm# Parameter 1: phone_local# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_comm(phone_local,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_comm(phone_local,TR,mask)}
REST API
GET /generate/phone_local?locale=TR# → {"type":"phone_local","result":"...","status":"ok"}GET /bulk/phone_local?count=10&locale=TRPOST /template {"types":["phone_local"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/phone_local?locale=TR&mask=trueGET /bulk/phone_local?count=5&locale=TR&mask=true

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages