Metadata-Version: 2.4
Name: dumph
Version: 1.3.7
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: xlsxwriter>=3.2,<4 ; extra == 'excel'
Requires-Dist: pyarrow>=17,<27 ; extra == 'parquet'
Requires-Dist: pytest>=8.3.5,<10 ; extra == 'test'
Requires-Dist: openpyxl>=3.1.5,<4 ; extra == 'test'
Provides-Extra: excel
Provides-Extra: parquet
Provides-Extra: test
License-File: LICENSE
Summary: Philippine mock data generator and python bindings for local dataset seeding, development workflows and automated testing.
Keywords: mock-data,philippines,dataset-generator,rust,pyo3,seeding
Author-email: "Christian Joyce G. Garcia" <cjggarcia.dev@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.8
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

<p align="center">
    <img src="https://gitlab.com/cjggarcia.dev/dumph/-/raw/main/assets/banner.png?ref_type=heads" alt="dumph banner">
</p>

<p align="center">
    <a href="https://pypi.org/project/dumph/"><img src="https://img.shields.io/pypi/v/dumph?style=flat-square&color=blue" alt="PyPI Version"></a>
    <a href="https://pypistats.com/packages/dumph"><img src="https://pypistats.com/api/badges/dumph?period=total" alt="PyPI Stats"></a>
    <a href="https://pypi.org/project/dumph/"><img src="https://img.shields.io/badge/python-%3E%3D3.8-blue?style=flat-square&logo=python&logoColor=white" alt="Python Versions"></a>
    <a href="https://www.rust-lang.org/"><img src="https://img.shields.io/badge/rust-1.85%2B-orange?style=flat-square&logo=rust" alt="Rust Version"></a>
    <a href="https://gitlab.com/cjggarcia.dev/dumph"><img src="https://img.shields.io/badge/GitLab-repo-fc6d26?style=flat-square&logo=gitlab&logoColor=white" alt="GitLab"></a>
    <a href="https://pypi.org/project/dumph/"><img src="https://img.shields.io/pypi/implementation/dumph?style=flat-square" alt="Python Implementation"></a>
    <a href="https://gitlab.com/cjggarcia.dev/dumph/-/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-green?style=flat-square" alt="License"></a>
</p>

# Dumph

> Philippine mock data generator and Python bindings for local dataset seeding, development workflows and automated testing

**Dumph** is a library for generating realistic Philippine mock data, with first-class Python bindings. It is built for database seeding, development workflows and automated testing, without maintaining hand-written fixtures or relying on foreign-locale generators.

Each record is generated as a coherent whole rather than a collection of independent random values:

- **Identity:** first names are matched to the record's gender, birthdates are consistent with the generated age and civil status is plausible for that age.
- **Contact:** email addresses are derived from the record's name and phone numbers follow Philippine carrier and area code conventions.
- **Geography:** barangay, city/municipality, province, region and ZIP code are always drawn from the same real location, so the address hierarchy is never mismatched.

The core is implemented in [Rust](https://rust-lang.org/) and exposed to Python through [PyO3](https://pyo3.rs/v0.29.3/). Geographic data spans *Luzon*, *Visayas* and *Mindanao* and is embedded directly in the compiled library, so [Dumph](https://gitlab.com/cjggarcia.dev/dumph) runs offline with no runtime data files, and ships with complete type hints for a smooth editor and type-checker experience.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
    - [Quick Start](#quick-start)
    - [Reproducible Output](#reproducible-output)
    - [Field Options](#field-options)
    - [Location Filters](#location-filters)
    - [Unique Values](#unique-values)
    - [Streaming](#streaming)
    - [Flexible Custom Types](#flexible-custom-types)
    - [Catalog datasets](#catalog-datasets)
    - [Linked datasets](#linked-datasets)
    - [Saving generated data](#saving-generated-data)
    - [Type Hints](#type-hints)
    - [Nested Address](#nested-address)
    - [Seeding a Database Example](#seeding-a-database-example)
    - [Notes](#notes)
- [API Reference](#api-reference)
    - [Arguments and Parameters](#arguments-and-parameters)
    - [Field Options Reference](#field-options-reference)
    - [Built-in Types](#built-in-types)
- [Data Sources](#data-sources)
- [Running the tests](#running-the-tests)
- [Changelog](#changelog)
- [License](#license)
- [Author](#author)

## Features

- **Localized Philippine data:** Filipino names, mobile and landline numbers and addresses.
- **Consistent rows:** Names match gender, birthdate matches age, civil status fits the age and emails come from the row's name.
- **Complete address hierarchy:** Region, province, city/municipality, barangay and ZIP code from the same real location.
- **Location filters:** Restrict generated addresses to an island group, region, province or city.
- **Reproducible output:** Pass a `seed` to get the same data every run, for stable test fixtures.
- **Field options:** Set ranges, date bounds, probabilities and uniqueness per column.
- **Unique values:** `unique=True` guarantees no repeats, for tables with unique constraints.
- **Streaming:** `seed_iter()` generates one row at a time for very large datasets.
- **Government and ID formats:** SSS, TIN, PhilHealth, PhilSys, Pag-IBIG, UMID, passport, driver's license and plate numbers.
- **Profile fields:** Middle name, suffix, username, occupation, employer, religion, height and weight.
- **Flexible dynamic types:** Built-in pattern matching for custom integer ranges, precision-controlled floats and custom choices.
- **Custom schemas:** Map your own column names to built-in field types.
- **Philippine catalogs:** Banks, products, shopping malls, higher-education campuses, and job roles.
- **Linked datasets:** Generate related businesses, sales, deliveries, transport, barangay requests, and agricultural market records.
- **Built-in export:** Save to JSON, CSV, JSON Lines, Excel, Parquet, or SQLite.
- **Rust core:** Native extension with a small Python API: `seed()`, `seed_iter()` and `save()`.
- **Fully typed:** [PEP 561](https://peps.python.org/pep-0561/) type stubs with `FieldType` and `FieldSpec`.
- **Offline generation:** Datasets are compiled into the library. Excel and Parquet writers are optional extras.

## Installation

Install from [PyPI](https://pypi.org/project/dumph):

```bash
pip install dumph
```

**Requirements:** Python 3.8 or newer.

Verify installation:

```bash
python -c "from dumph import Dummy; print(Dummy())"
```

## Usage

### Quick start

```python
from dumph import Dummy


dump = Dummy()

schema = {
    'ID': 'uuid',
    'Firstname': 'first_name',
    'Lastname': 'last_name',
    'Gender': 'gender',
    'Birthdate': 'birthdate',
    'Age': 'age',
    'Email': 'email',
    'Phone': 'phone_number',
    'Barangay': 'barangay',
    'City/Municipality': 'city_mun',
    'Province': 'province',
    'Region': 'region',
    'Zip Code': 'zip_code',
}

# Generate 100 rows of consistent, localized records
data = dump.seed(row=100, feature=schema)

print(data[0])
```

> `seed()` returns a `list` of `dict`s. Each key is a column header from your schema and each value is generated according to the field type you mapped it to.

### Reproducible output

Pass `seed` to get identical data on every run. Because birthdates and ages depend on today's date, also pass `as_of` for output that is identical on any day:

```python
a = dump.seed(row=50, feature=schema, seed=42, as_of='2026-01-01')
b = dump.seed(row=50, feature=schema, seed=42, as_of='2026-01-01')

assert a == b
```

> Output is stable for the same Dumph version. It is not guaranteed to stay identical across releases.

### Field options

Replace a field type string with a dict to configure that column:

```python
schema = {
    'Name': 'full_name',
    'Age': {'type': 'age', 'min': 18, 'max': 30},
    'Score': {'type': 'integer', 'min': 1, 'max': 10},
    'Hired': {'type': 'date', 'start': '2022-01-01', 'end': '2025-12-31'},
    'Active': {'type': 'boolean', 'probability': 0.8},
    'Email': {'type': 'email', 'unique': True},
}

data = dump.seed(row=100, feature=schema)
```

See the [field options reference](#field-options-reference) for every option.

### Location filters

Restrict generated addresses with `region`, `province` and `city_mun`:

```python
# Any location in Mindanao
data = dump.seed(row=100, feature=schema, region='Mindanao')

# A single province
data = dump.seed(row=100, feature=schema, province='Misamis Oriental')
```

Filters are case-insensitive. `region` matches an island group (`Luzon`, `Visayas`, `Mindanao`) or part of a region name. `province` and `city_mun` use an exact name when one exists, otherwise a partial match. A filter that matches nothing raises `ValueError`.

### Unique values

Set `unique` on a column to guarantee no repeated values within a call:

```python
schema = {
    'ID': {'type': 'uuid', 'unique': True},
    'Email': {'type': 'email', 'unique': True},
    'TIN': {'type': 'tin_number', 'unique': True},
}
```

When a value repeats, the whole row is regenerated, so related fields stay consistent. If the pool of possible values runs out (for example, a unique `blood_type` across many rows), `ValueError` is raised.

### Streaming

`seed_iter()` takes the same arguments as `seed()` but returns an iterator that generates one row at a time, so memory use stays flat for large datasets:

```python
for record in dump.seed_iter(row=1_000_000, feature=schema, seed=1):
    ...  # insert, write, or process one row at a time
```

### Flexible Custom Types

You can use dynamic patterns to configure custom ranges and selections directly inside your schema:

```python
schema = {
    'Name': 'full_name',
    'Score': 'int:50:100',
    'Rating': 'float:1.0:5.0:2',
    'Department': 'choice:HR,IT,Sales,Finance'
}

data = dump.seed(row=100, feature=schema)
```

### Catalog datasets

Related fields come from the same catalog record. Product variants have their own SKU and fictional price in Philippine pesos. The bank, mall, and campus catalogs contain real institution names for test fixtures. The job catalog covers common roles across many industries.

The [product catalog](src/data/06_catalog/products.json) contains 290 mock variants across 20 categories. It includes groceries, produce, seafood, regional specialties, apparel, footwear, household and school supplies, hardware, electronics, handicrafts, and everyday farm and motorcycle supplies. Each variant has a category, subcategory, selling unit, and mock peso price. Existing SKUs remain available.

The [higher-education catalog](src/data/06_catalog/universities.json) contains 2,622 university, college, and school campuses in 813 cities and municipalities across all 18 regions. It combines public CHED and Bangsamoro education ministry listings with campus locations that could be matched to the bundled geography. Use `school_name` or its alias `university_name` for the institution. `campus_name` uses the campus label where available and the directory listing name otherwise.

```python
products = {
    'SKU': 'sku',
    'Product': 'product_name',
    'Category': 'product_category',
    'Subcategory': 'product_subcategory',
    'Variant': 'variant',
    'Unit': 'product_unit',
    'Price (PHP)': 'price_php',
}
davao = {
    'Mall': 'mall_name',
    'University': 'university_name',
    'Campus': 'campus_name',
    'City': 'city_mun',
}

rows = dump.seed(row=10, feature=davao, city_mun='Davao', seed=42)
```

Mall and campus selection honors `region`, `province`, and `city_mun` filters. When both are requested, they share the same city or municipality and match any address fields on the row. A filter with no matching catalog entries raises `ValueError`.
NCR address rows use an empty province because its cities and municipality sit directly under the region in the bundled data.

### Linked datasets

`Dummy.seed_dataset(dataset, rows=100, *, seed=None, region=None, province=None, city_mun=None, as_of=None)` returns a dictionary of table names and their rows. Use `seed` and `as_of` to reproduce a fixture.

| Dataset | What `rows` counts | Tables |
|---|---|---|
| `products` | Unique product variants, up to the catalog size | `products` |
| `businesses` | Businesses | `businesses`, `branches` |
| `sales` | Sales | `businesses`, `stores`, `products`, `sales`, `sale_items`, `payments`, `inventory_movements` |
| `sari_sari_store` | Sales with a sari-sari product assortment | Same tables as `sales` |
| `deliveries` | Shipments | `shipments`, `tracking_events` |
| `transport` | Routes | `routes`, `departures` |
| `barangay_services` | Households | `households`, `residents`, `service_requests` |
| `agriculture` | Markets and their produce lots | `markets`, `produce_lots` |

The location filters apply to a preset's primary location, such as its stores, households, markets, or shipment and route origins. Shipment destinations can come from anywhere in the Philippines. The standalone product catalog is nationwide. Prices, fares, schedules, business names and service requests are mock data.

```python
from dumph import Dummy

dump = Dummy()
tables = dump.seed_dataset(
    'sari_sari_store', rows=100, region='Davao Region', seed=42, as_of='2026-01-01',
)
dump.save(tables, 'store_fixtures', 'sqlite')
dump.save(tables['sales'], 'sales', 'json')
```

Pass the whole dataset to SQLite or Excel, or export individual tables with any supported format.

The [transport catalog](src/data/07_fixtures/transport.json) contains 105 corridors across 120 Philippine cities and municipalities. It includes jeepneys, modern jeepneys, tricycles, buses, UV Express, passenger ferries, RoRo ferries, rail, and domestic flights. An unfiltered batch of at least 18 rows includes an origin in every Philippine region. Regional, province, and city filters restrict the origin. Locations without a catalog corridor use local land routes.

Routes identify their scope, origin and destination cities, provinces and regions, terminals, and mock fare. The departure table links trips to routes and uses Philippine time (`+08:00`). Named stations, ports, and airports anchor synthetic connections and timetables.

### Saving generated data

```python
dump.save(dump.seed(row=10, feature=products), 'products', 'json')
dump.save(dump.seed_iter(row=100, feature=products), 'products', 'jsonl')
```

| Format | Extension | Behavior |
|---|---|---|
| JSON | `.json` | Indented array of records. |
| CSV | `.csv` | Headers follow the column order of the first record. Nested values use their Python string representation. |
| JSON Lines | `.jsonl` | One JSON record per line. |
| Excel | `.xlsx` | Accepts named worksheets. Install with `pip install 'dumph[excel]'`. |
| Parquet | `.parquet` | Infers column types from the records and collects rows in memory. Install with `pip install 'dumph[parquet]'`. |
| SQLite | `.sqlite` | Accepts named tables. Tables are created from the columns of their first record and empty datasets are skipped. |

The extension is added automatically. All formats accept a list or iterator of records. JSON, CSV, JSON Lines, Excel, and SQLite write rows incrementally. Excel and SQLite also accept a mapping of names to row iterables, and use `data` as the default sheet or table name for a single iterable. Both serialize nested values as JSON text.

```python
dump.save(
    {
        'products': dump.seed_iter(row=30, feature=products, seed=1),
        'davao_locations': dump.seed_iter(row=10, feature=davao, city_mun='Davao', seed=2),
    },
    'fixtures',
    'xlsx',
)
```

### Type hints

Dumph ships with type stubs and a `py.typed` marker. Use `FieldSpec` to get autocompletion and static checking for your schema, including options dicts:

```python
from typing import Dict

from dumph import Dummy, FieldSpec

schema: Dict[str, FieldSpec] = {
    'ID': 'uuid',
    'Name': 'full_name',
    'Phone': 'phone_number',
    'Age': {'type': 'age', 'min': 18, 'max': 30},
    'Rating': 'float:1.0:5.0:2',
}

rows = Dummy().seed(row=100, feature=schema)
```

> Annotating the schema variable is recommended. Without it, type checkers infer `dict[str, str]` for a variable and will reject it. Passing the dictionary literal directly to `seed()` needs no annotation.

### Nested Address

```python
dump = Dummy()
rows = dump.seed(row=1, feature={'Location': 'address'})

# {
#     'Location': {
#         'barangay': '...',
#         'city': '...',
#         'province': '...',
#         'region': '...',
#         'zip_code': '...'
#     }
# }
```

### Seeding a database (example)

```python
from dumph import Dummy

dump = Dummy()

residents = dump.seed(
    row=500,
    feature={
        'first_name': 'first_name',
        'last_name': 'last_name',
        'birthdate': 'birthdate',
        'civil_status': 'civil_status',
        'barangay': 'barangay',
        'city_mun': 'city_mun',
    },
    seed=42,
)

# Use the records with your ORM or SQL client of choice,
# e.g., Django's Model.objects.bulk_create(...)
```

### Notes

- Column names in the schema are fully up to you, only the **values** must be valid field types.
- Unknown field types, unknown options and invalid ranges raise `ValueError`. For a typo such as `'frist_name'`, the error suggests the closest valid type and lists all valid types.
- Fields generated within the same row share state. For example, `first_name`, `full_name`, `gender` and `email` always agree, `civil_status` fits `age`, `weight_kg` fits `height_cm` and all address fields come from the same location.
- Emails vary in format from row to row (for example `juan.delacruz`, `jdelacruz` or `juan_delacruz42`). Use `unique=True` when you need no duplicates.
- `suffix` is `None` for most rows and is only generated for men. In CSV, `None` is written as an empty cell.
- Nested values (such as `address`) are best exported to JSON. In CSV they are written as their Python string representation.
- Generated records are for development and testing. Address and institution fields use real place and organization names. Government ID numbers follow format conventions only.

## API Reference

### Arguments and Parameters

#### `Dummy()`

Creates a new generator instance. Takes no arguments.

#### `Dummy.seed(row, feature, *, seed, region, province, city_mun, as_of)`

Generates mock records.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `row` | `int` | Yes | Number of records (rows) to generate. |
| `feature` | `dict` | Yes | Schema mapping each output column name (`str`) to a [built-in field type](#built-in-types) (`str`) or an [options dict](#field-options-reference). Order is preserved. |
| `seed` | `int` | No | Seed for reproducible output. Omit for random output each call. |
| `region` | `str` | No | Restrict locations to an island group (`Luzon`, `Visayas`, `Mindanao`) or part of a region name. |
| `province` | `str` | No | Restrict locations to a province. |
| `city_mun` | `str` | No | Restrict locations to a city or municipality. |
| `as_of` | `str` | No | Reference date (`YYYY-MM-DD`) used for ages and birthdates. Defaults to today. |

The parameters after `feature` are keyword-only.

**Returns:** `list[dict]`, one dictionary per generated row.

**Raises:** `ValueError` for unknown field types or options, invalid ranges or dates, no matching location, or an exhausted `unique` pool.

#### `Dummy.seed_iter(row, feature, *, seed, region, province, city_mun, as_of)`

Same parameters as `seed()`. Returns an iterator that yields one `dict` per row instead of building a list.

#### `Dummy.save(data, filename, fmt)`

Writes generated data to a file. Excel and SQLite also accept named datasets.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `data` | `Iterable[dict]` or `Mapping[str, Iterable[dict]]` | Yes | Records from `seed()` or `seed_iter()`, or named datasets for Excel and SQLite. |
| `filename` | `str` | Yes | Output file name **without** extension. The extension is appended based on `fmt`. |
| `fmt` | `ExportFormat` | Yes | `'json'`, `'csv'`, `'jsonl'`, `'xlsx'`, `'parquet'`, or `'sqlite'` (case-insensitive). |

**Returns:** `None`. A confirmation message is printed on success.

**Raises:** `ValueError` for an unsupported format, or `ImportError` if an optional writer is missing.

### Field Options Reference

A schema value can be a field type string, or a dict with a required `type` key and any of these options:

| Option | Type | Applies to | Description |
|---|---|---|---|
| `type` | `str` | All | Required. Any [built-in type](#built-in-types). |
| `min` | `int` | `age`, `birthdate`, `integer` | Lower bound. Age defaults to 18, integer to 0. |
| `max` | `int` | `age`, `birthdate`, `integer` | Upper bound. Age defaults to 70, integer to 100. |
| `start` | `str` | `date` | Earliest date, `YYYY-MM-DD`. Defaults to `2020-01-01`. |
| `end` | `str` | `date` | Latest date, `YYYY-MM-DD`. Defaults to today (or `as_of`). |
| `probability` | `float` | `boolean` | Chance of `True`, from 0 to 1. Defaults to 0.5. |
| `unique` | `bool` | All | Guarantee no repeated values. Defaults to `False`. |

> `age` and `birthdate` share one age range, so `min` and `max` on either column apply to both.

### Built-in Types

#### Utility

| Type | Alias | Output | Description |
|---|---|---|---|
| `uuid` | `id` | `str` | Random UUID (v4). |
| `color` | none | `str` | Random color name. |
| `status` | none | `str` | Random status value. |

#### Personal

| Type | Output | Description |
|---|---|---|
| `first_name` | `str` | Filipino first name, matching the row's gender. |
| `middle_name` | `str` | Middle name, taken from a Filipino surname. |
| `last_name` | `str` | Filipino surname. |
| `full_name` | `str` | First and last name combined. |
| `suffix` | `str` or `None` | Generational suffix (`Jr.`, `II`, `III` and similar). Men only, `None` for most rows. |
| `gender` | `str` | `Male` or `Female`. |
| `birthdate` | `str` | Date in `YYYY-MM-DD` format, exactly matching `age`. |
| `age` | `int` | Age between 18 and 70 by default. Configurable with `min` and `max`. |
| `civil_status` | `str` | `Single`, `Married`, `Widowed` or `Separated`, weighted by age. |
| `blood_type` | `str` | Blood type (e.g. `O+`). |
| `email` | `str` | Email built from the row's first and last name in one of several common formats, such as `juan.delacruz`, `jdelacruz` or `juan_delacruz42`. |
| `username` | `str` | Username built from the row's name, e.g. `juan_delacruz42`. |

#### Profile

| Type | Output | Description |
|---|---|---|
| `occupation` | `str` | Common occupation. |
| `employer` | `str` | Generic employer or institution. |
| `religion` | `str` | Religion, weighted by approximate national distribution. |
| `height_cm` | `int` | Height in centimeters, based on the row's gender. |
| `weight_kg` | `float` | Weight in kilograms, plausible for the row's height. |

#### Contact

| Type | Output | Description |
|---|---|---|
| `phone_number` | `str` | Philippine mobile number with a carrier prefix, formatted as `+63 <prefix> <number>`. |
| `landline` | `str` | Landline number with an area code, formatted as `(<area code>) <number>`. |

#### Geographic

> All geographic types in a single row come from the **same** location.

| Type | Output | Description |
|---|---|---|
| `address` | `dict` | Nested object with `barangay`, `city`, `province`, `region` and `zip_code`. |
| `full_address` | `str` | `Barangay, City/Municipality, Province, Region ZIP`. |
| `barangay` | `str` | Barangay name. |
| `city_mun` | `str` | City or municipality name. |
| `province` | `str` | Province name. |
| `region` | `str` | Region name. |
| `zip_code` | `str` | ZIP code of the city/municipality. |

#### Government and IDs

| Type | Output | Description |
|---|---|---|
| `sss_number` | `str` | Social Security System number. |
| `tin_number` | `str` | Tax Identification Number (`XXX-XXX-XXX-XXX`). |
| `philhealth_number` | `str` | PhilHealth identification number. |
| `philsys_number` | `str` | PhilSys Card Number, 16 digits (`XXXX-XXXX-XXXX-XXXX`). |
| `pagibig_number` | `str` | Pag-IBIG MID number, 12 digits (`XXXX-XXXX-XXXX`). |
| `umid_number` | `str` | UMID CRN, 12 digits (`XXXX-XXXXXXX-X`). |
| `passport_number` | `str` | Passport number (`P1234567A`). |
| `drivers_license` | `str` | Driver's license number, starting with the row's surname initial. |
| `plate_number` | `str` | Vehicle plate number (`ABC 1234`). |

#### Catalogs

| Fields | Output | Description |
|---|---|---|
| `bank_name`, `bank_short_name`, `bank_type` | `str` | Institution name, short name, and category. |
| `product_name`, `product_category`, `product_subcategory`, `product_unit`, `sku`, `variant` | `str` | Name, classification, and selling unit for the same mock product variant. |
| `price_php` | `float` | Fictional unit price in Philippine pesos for the selected variant. |
| `mall_name` | `str` | Mall in the row's city or municipality. |
| `school_name`, `university_name`, `campus_name` | `str` | Higher-education institution and campus in the row's city or municipality. |
| `job_title`, `industry`, `seniority` | `str` | Title, industry, and seniority from the same job role. |

#### Generic

| Type | Output | Description |
|---|---|---|
| `integer` | `int` | Random integer. Use `min` and `max` (default 0 to 100). |
| `date` | `str` | Random date in `YYYY-MM-DD` format. Use `start` and `end`. |
| `boolean` | `bool` | Random `True` or `False`. Use `probability` (default 0.5). |

#### Dynamic / Flexible Custom Types

| Pattern Syntax | Output | Description |
|---|---|---|
| `int:min:max` | `int` | Randomized integer within the inclusive range `[min, max]` (e.g., `'int:10:50'`). |
| `float:min:max:decimals` | `float` | Randomized floating-point number within range, rounded to specified decimal places (e.g., `'float:1.0:5.0:2'`). |
| `choice:val1,val2,...` | `str` | Randomly picks one value from a comma-separated list of strings (e.g., `'choice:Yes,No'`). |

## Data Sources

[Dumph](https://gitlab.com/cjggarcia.dev/dumph) datasets are compiled from publicly available sources:

| Data | Source |
|------|--------|
| First names | [Forebears.io - Philippines forenames](https://forebears.io/philippines/forenames) |
| Surnames | [Forebears.io - Philippines surnames](https://forebears.io/philippines/surnames) |
| Regions, provinces, cities/municipalities, barangays and ZIP codes | [PSGC Cloud API](https://psgc.cloud/api-docs/v2) |
| Selected bank names and categories | [Bangko Sentral ng Pilipinas directories](https://www.bsp.gov.ph/SitePages/FinancialStability/DirBanksFIList.aspx) |
| Selected malls | [SM Supermalls](https://www.smsupermalls.com/mall-directory), [Ayala Malls](https://www.ayalamalls.com/) |
| Higher-education institutions and campuses | [CHED Higher Education Directory](https://heida.ched.gov.ph/hei-directory), [Bangsamoro Recognized HEIs Directory](https://mbhte.bangsamoro.gov.ph/sub-sectors/higher-education/higher-ed-overview/heis), and [University of the Philippines campus information](https://up.edu.ph/constituent-universities/) |
| Products and job roles | Curated [JSON fixtures](src/data/06_catalog/) with product categories informed by [DTI price and supply monitoring](https://fairtrade.dti.gov.ph/services/monitoring-and-enforcement/) and the [DTI product catalog](https://msmehub.dti.gov.ph/catalogue/) |
| Linked datasets | Bundled [JSON fixtures](src/data/07_fixtures/) with agricultural categories informed by the [Department of Agriculture](https://amia.da.gov.ph/national-color-coded-agricultural-guide-nccag-map/) |
| Transport locations | [Philippine Ports Authority](https://www.ppa.com.ph/sites/default/files/issuances_docs/PPA_MC_No005_2026_03032026.pdf), [Light Rail Transit Authority](https://www.lrta.gov.ph/railway-operations/), and [Civil Aviation Authority of the Philippines](https://www.caap.gov.ph/area-centers/) |

## Running the tests

From the repository root, build the Python package with the test and export extras and run the suite.

```bash
python -m pip install '.[test,excel,parquet]'
python -m pytest -q
```

## Changelog

See [CHANGELOG.md](https://gitlab.com/cjggarcia.dev/dumph/-/blob/main/CHANGELOG.md) for the list of changes in each release.

## License

This project is licensed under the [Apache License 2.0](https://gitlab.com/cjggarcia.dev/dumph/-/blob/main/LICENSE?ref_type=heads)

## Author

Created and maintained by [cjggarcia.dev](https://gitlab.com/cjggarcia.dev)

