This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

PGen provides generating of data and tests with given format (numbers, string, graphs, etc). PGEN IS STILL IN ACTIVE DEVELOPMENT AND CONTAINS BUGS. If you find a bug please file a report in the issues section.

Features:

  • Input format is JSON-text or object
  • Unlimited depth of data
  • Pure python without dependencies
  • Basic types generation (int, double, string)
  • Generation of complex types (graph, tree, container)

Installation:

pip install PGen

Documentation:

Basic types:

  • int
  • double
  • string

Complex types:

  • pair
  • container
  • array
  • tree
  • graph

Will be extended soon…

Examples:

Typical usage often looks like this:

#!/usr/bin/env python

from pgen.generator import Generator

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

generator = Generator(data_description)
generator.write()

Using variable name:

#!/usr/bin/env python

from pgen.generator import Generator

data_description = {
    'seed': 42,
    'count': 3,
    'format': {
        'type': 'container',
        'elements': [
            {'name': 'n', 'type': 'int', 'from': 3, 'to': 15},
            {
                'type': 'array', 'length': 'n', 'subelement': {
                    'type': 'int',
                    'from': 0,
                    'to': 1
                }
            }
        ]
    },
    'output': {
        'type': 'file',
        'format': 'tests/y_{0:03d}.dat',
        'start_index': 3
    }
}

generator = Generator(data_description)
generator.write()

String patterns:

#!/usr/bin/env python

from pgen.generator import Generator

data_description = {
    'seed': 42,
    'count': 3,
    'format': {
        'type': 'string',
        'length': 32,
        'patterns': ['A-B', 'a-b']
    },
    'output': {
        'type': 'file',
        'format': 'test/{0:03d}_out.dat',
        'start_index': 3
    }
}

generator = Generator(data_description)
generator.write()
Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PGen-0.2.1.zip (18.6 kB) Copy SHA256 Checksum SHA256 Source Dec 25, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting