Skip to main content

Useful tool to generate data & tests

Project description

pgen provides generating of data and tests with given format (numbers, string, graphs, etc). Typical usage often looks like this:

#!/usr/bin/env python

from pgen.generator import Generator

data_description = {
    'format': {
        'name': 'N',
        'type': 'int',
        'from': 10,
        'to': 100
    },
    'output': {
        'type': 'file',
        'format': 'tests/{0:03d}.dat',
        'start_index': 3
    }
}
data_seed = 42
data_count = 3

generator = Generator(data_description, data_seed)
generator.write(data_count)

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

PGen-0.1.zip (17.5 kB view hashes)

Uploaded Source

Supported by

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