Skip to main content

Generate fake Canadian-style test data with a simple CLI or Python module.

Project description

CanadaTestGen

CanadaTestGen is a Python CLI tool and library to generate realistic Canadian-themed test data based on customizable JSON schemas. It supports generating data such as names, email addresses, SIN numbers, postal codes, provinces, and more — outputting results in JSON or CSV format.


Features

  • Generate realistic Canadian test data quickly and easily
  • Supports JSON and CSV output formats
  • Customizable schema for flexible data generation
  • Command-line interface (CLI) for easy use
  • Can be used as a Python library for integration in your projects

Installation

You can install CanadaTestGen via pip:

pip install canadatestgen

Or clone this repo and install locally:

git clone https://github.com/GuiNom16/canadatestgen.git
cd canadatestgen
pip install -e .

Usage

CLI

canadatestgen --schema path/to/schema.json --count 10 --format json --output output.json

Arguments

Option Description Default Example
--schema Path to the JSON schema file (required) N/A schema.json
--count Number of records to generate 10 50
--format Output format: json or csv json csv
--output Output file path (optional; prints to stdout if omitted) N/A data.csv

Schema Example

The schema defines fields and their types. Example schema.json:

{
  "full_name": "name",
  "email_address": "email",
  "sin_number": "sin",
  "postal_code": "postal_code",
  "province": "province",
  "signup_date": "date",
  "is_active": "boolean"
}

Python Usage

You can also use CanadaTestGen as a Python library:

from canadatestgen.schema_loader import generate_data

data = generate_data("schema.json", count=5)
print(data)

Running Tests

To run unit tests:

pytest

License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Jeremie Nombro
Email: guillaumenombro@gmail.com
Location: Fredericton, New Brunswick, Canada


Contributions

Contributions, issues, and feature requests are welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canadatestgen-0.1.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canadatestgen-0.1.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file canadatestgen-0.1.2.tar.gz.

File metadata

  • Download URL: canadatestgen-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for canadatestgen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7cf2b2212666b0624285fd2f56d26ad15ac11c6a67362878d167c5e7c6c5224e
MD5 a0cfa1ec517091fee8af2cf8a3775b1c
BLAKE2b-256 5eade82ead1a2ae52f58c9ff7124e49392def74121d639f62e9b369aefb7118a

See more details on using hashes here.

File details

Details for the file canadatestgen-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: canadatestgen-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for canadatestgen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76719eb069b055c0b0dd2d8c214255701f012b595b7f3bc38978dce77ccdd0b0
MD5 a25de14e89d7e0f52097e43fc7dc0152
BLAKE2b-256 b77a5411885205a82020eab2f145c224d3796ddc1b28c974af11143d71e81a9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page