Skip to main content

dumph banner

PyPI Version PyPI Stats Python Versions Rust Version GitLab Python Implementation License

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 and exposed to Python through PyO3. Geographic data spans Luzon, Visayas and Mindanao and is embedded directly in the compiled library, so 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

  • 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 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:

pip install dumph

Requirements: Python 3.8 or newer.

Verify installation:

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

Usage

Quick start

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 dicts. 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:

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:

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 for every option.

Location filters

Restrict generated addresses with region, province and city_mun:

# 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:

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:

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:

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 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 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.

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.

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 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

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.

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:

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

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

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

Seeding a database (example)

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 (str) or an options dict. 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.
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 datasets are compiled from publicly available sources:

Data Source
First names Forebears.io - Philippines forenames
Surnames Forebears.io - Philippines surnames
Regions, provinces, cities/municipalities, barangays and ZIP codes PSGC Cloud API
Selected bank names and categories Bangko Sentral ng Pilipinas directories
Selected malls SM Supermalls, Ayala Malls
Higher-education institutions and campuses CHED Higher Education Directory, Bangsamoro Recognized HEIs Directory, and University of the Philippines campus information
Products and job roles Curated JSON fixtures with product categories informed by DTI price and supply monitoring and the DTI product catalog
Linked datasets Bundled JSON fixtures with agricultural categories informed by the Department of Agriculture
Transport locations Philippine Ports Authority, Light Rail Transit Authority, and Civil Aviation Authority of the Philippines

Running the tests

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

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

Changelog

See CHANGELOG.md for the list of changes in each release.

License

This project is licensed under the Apache License 2.0

Author

Created and maintained by cjggarcia.dev

Metadata

Release files for dumph 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dumph 1.3.7
File Size Uploaded Provenance Actions
dumph-1.3.7.tar.gz 1.5 MB Without provenance Details for dumph-1.3.7.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dumph 1.3.7
File Interpreter ABI Platform Actions
dumph-1.3.7-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for dumph-1.3.7-cp38-abi3-win_amd64.whl
dumph-1.3.7-cp38-abi3-manylinux_2_34_x86_64.whl CPython 3.8 abi3 Linux glibc 2.34+ x86-64 Details for dumph-1.3.7-cp38-abi3-manylinux_2_34_x86_64.whl

Total release size: 3.6 MB

Release files / dumph-1.3.7.tar.gz

Download URL dumph-1.3.7.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
faced9c659d7aaf57182a99faf43fdcff070a70de15c271b5294b37100113b11
BLAKE2b-256 checksum
How to use checksums
748744fd3bbcf6aaee3b8cb848f9e315d08b89662243d6252d5fa990a004078c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / dumph-1.3.7-cp38-abi3-win_amd64.whl

Download URL dumph-1.3.7-cp38-abi3-win_amd64.whl
Size 993.6 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
824ef581cbbcecdb5fa8fd85476dc24086c9ebce0c50a491f1000ce4b5176a23
BLAKE2b-256 checksum
How to use checksums
5c75b26b4d422ae42385c1636e19c417f1bb6974d2749057eb1c0f1468286792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Release files / dumph-1.3.7-cp38-abi3-manylinux_2_34_x86_64.whl

Download URL dumph-1.3.7-cp38-abi3-manylinux_2_34_x86_64.whl
Size 1.2 MB
Tags CPython 3.8 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
566cf64ddad77d36370fe1bb7fb73839ab6399a301cc4a7e56620445f94ae3c4
BLAKE2b-256 checksum
How to use checksums
ab1732c1f5aa2c29b9d1bd0354371696034ece5d46ff7602f03031d65818a6f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.16.0

Security for dumph 1.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page