This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Fixture generator for fixture module

Project Description

Supports only SQLAlchemy

Install

Using pip

pip install fixturegen

Or using easy_install

easy_install fixturegen

Usage

Basic

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user
from fixture import DataSet

class UserData(DataSet):
    class user_1:
        id = 1
        name = u'first'
    class user_2:
        id = 2
        name = u'second'
    class user_3:
        id = 3
        name = u'third'

Limiting

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --limit=2
from fixture import DataSet

class UserData(DataSet):
    class user_1:
        id = 1
        name = u'first'
    class user_2:
        id = 2
        name = u'second'

Ordering

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --order-by='id DESC'
from fixture import DataSet

class UserData(DataSet):
    class user_3:
        id = 3
        name = u'third'
    class user_2:
        id = 2
        name = u'second'
    class user_1:
        id = 1
        name = u'first'

Filtering

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --where='id > 1'
from fixture import DataSet

class UserData(DataSet):
    class user_2:
        id = 2
        name = u'second'

Hide import statement

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --limit=1 --without-import
class UserData(DataSet):
    class user_1:
        id = 1
        name = u'first'

Custom fixture class name:

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --fixture-class-name DummyData --limit=1
class Dummy(DataSet):
    class user_1:
        id = 1
        name = u'first'

Custom row class naming:

$ fixturegen-sqlalchemy mysql://user:password@localhost/your_db user --naming-row-columns=id,name --limit=1
class Dummy(DataSet):
    class user_1_first:
        id = 1
        name = u'first'

Help

$ fixturegen-sqlalchemy --help
Release History

Release History

This version
History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fixturegen-0.8.tar.gz (4.3 kB) Copy SHA256 Checksum SHA256 Source May 9, 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