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

Uploaded Python 3

File details

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

File metadata

  • Download URL: canadatestgen-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b7cc8a0815d5797d10468cfa0abf9d08a859bb172f327a6e030f1b1c396dee22
MD5 f2c8d3db21040bd2b4b044be853564e5
BLAKE2b-256 85064d7780d0b2bc453bd5237b3b79c431755a68476eedcf5b90156265cc6b87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: canadatestgen-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5989387b2ceb05f9322271f070f1916f326d32a3f28dfeadebc3315daff4b52b
MD5 733f031a8f06efe16e971e274d4a9965
BLAKE2b-256 ff4dabe4c96ec88f0551c2944ee2bc83d33b707025d21928a794a0a5dc4433af

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