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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: canadatestgen-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 522efe582ad1de9a22786d7e30fbdc40d49aa8cb3b418ce13a14b4bc2532584d
MD5 c353dda9e77a58dbb39d90aee4707bf2
BLAKE2b-256 027f8ffbf507c015aa4a43de153d79a368328f6a86a9eff19ac4a7e073d23afd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: canadatestgen-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b99b0c4f26cf4ce09e8e178260ce6302c6400d6110bc6596cd7948d8eb29e0de
MD5 d886ac36098c4ac50261b5f866893aaa
BLAKE2b-256 1c99890d84bdc4a2ab8c8d98ab840ed0f46bcf481f30153eb5135ee59c3ddbbb

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