Metadata-Version: 1.1
Name: tesdat
Version: 1.0.3
Summary: tesdat is a package to generate testdata.
Home-page: https://bitbucket.org/crohaco/tesdat
Author: crohaco
Author-email: crohaco.net@gmail.com
License: PSF
Description: **tesdat** is a package to generate testdata.
        
        Requirements
        ============
        - Python 2.6 or later.
        - Python 2.5 and simplejson.
        
        How to use
        ==========
        
        Basic Example
        -------------
        
        .. code-block:: html
        
         >>> import tesdat
         >>> model = tesdat.Model({
             'id': tesdat.IncrementPattern(),
             'x': tesdat.CyclePattern(['a', 'b', 'c']),
         })
         >>> container = tesdat.ListContainer(model)
         >>> container.repeat(5)  # repeat 5 times.
         >>> container.render()
         [{'x': 'a', 'id': 1}, {'x': 'b', 'id': 2}, {'x': 'c', 'id': 3}, {'x': 'a', 'id': 4}, {'x': 'b', 'id': 5}]
         >>> container.output('test.json')  # output as json(default)
        
        TSV Example
        -----------
        
        .. code-block:: html
        
         >>> import tesdat
         >>> model = tesdat.Model([
         ...     tesdat.IncrementPattern(start=10, step=5, callback=str),
         ...     tesdat.HashPattern(2, 'md5'),  # hashing value of the third column.
         ...     tesdat.ChoicePattern(['foo', 'bar', 'baz']),
         ...     tesdat.CyclePattern(range(0, 30, 10), callback=str),
         ... ])
         >>> # render in the order that specified in the arguments.
         >>> model.ordering(2)
         >>> container = tesdat.ListContainer(model)
         >>> # repeat count can be specified as an argument to the render-function.
         >>> container.render(10)  # repeat 10 times.
         >>> def add_label(rows):
         ...     rows.insert(0, ['id', 'hash-of-name', 'name', 'value'])
         ...     return rows
         >>> def convert_tsv(rows):
         ...     return '\n'.join([
         ...         '\t'.join(cols) for cols in rows
         ...     ])
         >>> container.set_shape(add_label)
         >>> container.set_stringify(convert_tsv)
         >>> container.output('test.tsv', rewrite=True)  # rewrite if test.tsv exists.
        
        
Keywords: testdata,tesdata
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development
